Dynamic fields are now validated on save
(MongoEngine/mongoengine#153) (MongoEngine/mongoengine#154)
This commit is contained in:
parent
c528ac09d6
commit
9cc02d4dbe
5 changed files with 33 additions and 1 deletions
|
|
@ -564,6 +564,10 @@ class DynamicField(BaseField):
|
|||
return StringField().prepare_query_value(op, value)
|
||||
return self.to_mongo(value)
|
||||
|
||||
def validate(self, value, clean=True):
|
||||
if hasattr(value, "validate"):
|
||||
value.validate(clean=clean)
|
||||
|
||||
|
||||
class ListField(ComplexBaseField):
|
||||
"""A list field that wraps a standard field, allowing multiple instances
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue