mongoengine-migrate
mongoengine-migrate copied to clipboard
Handle `Document` and `EmbeddedDocument` in `choices` of `Field`
Field declaration can contains choices
attribute which sets possible values which this field can have. choices
in turn can be an array of any value including Document
and EmbeddedDocument
classes. I.e.
my_field = DynamicField(choices=[Document1, EmbeddedDocument2])
In this case the field accepts only instances of these documents.
It's needed to figure out what to do when choices (new and old states) contain document classes during migration.