Skip to content
This repository was archived by the owner on Apr 6, 2026. It is now read-only.
This repository was archived by the owner on Apr 6, 2026. It is now read-only.

Use a Dynamodel in a ModelSerializer #111

Description

@vinceh91

Hi!
Is it possible to use DynaModel as a regular Django Model in a ModelSerializer?
Cause when I do so I have the exception:
"[MyDynaModel] object does not have a "_meta" attribute"

My code:

models.py

class Event(DynaModel):

    class Table:
        resource_kwargs = {
            'endpoint_url': 'http://localhost:8000'}
        name = 'Event'
        hash_key = 'a'
        read = 1
        write = 1

    class Schema:
        a = fields.Decimal()
        d = fields.String()

serializers.py

class EventSerializer(serializers.ModelSerializer):
    class Meta:
        model = Event
        fields = ('a', 'd')

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions