Skip to content

Ignore DictField and ListField when not required #2342

@thomasstats

Description

@thomasstats

Currently if I have an object such as

class Foo(DynamicDocument): _id = ObjectIdField(required=True, default=ObjectId, primary_key=True) bar = DictField()

When I create a new item and add it I get:

{ _id: ObjectId(<objectid>), bar: {} }

I would rather this be

{ _id: ObjectId(<objectid>) }

Is there a way to do this currently? List has similar behavior by creating a [].

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions