Skip to content

Create model instances containing the field _created #1831

Open
@cchayden

Description

@cchayden

Eve (http://python-eve.org/) writes mongo documents containing the field :_created". It uses this to hold a timestamp for the document creation time. When I retrieve this object, the call to the model constructor files in base/document.py line 722 looks like this:
obj = cls(__auto_convert=False, _created=created, __only_fields=only_fields, **data)
At this point, data is a dict containing a key "_created" so this call fails because there are multiple values for the keywork "_created".

Is there any easy way to use a different internal keyword other than _created for this purpose, so that it does not clash with what is in the database? Or is there some other way around this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions