mongoengine-migrate icon indicating copy to clipboard operation
mongoengine-migrate copied to clipboard

Handle `Document` and `EmbeddedDocument` in `choices` of `Field`

Open bdragon300 opened this issue 4 years ago • 0 comments

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.

bdragon300 avatar Dec 14 '20 19:12 bdragon300