Merge branch 'dev' of https://github.com/aparrish/mongoengine into 466
This commit is contained in:
commit
3b5b715567
2 changed files with 3 additions and 1 deletions
|
|
@ -8,7 +8,7 @@ import uuid
|
||||||
from bson import Binary, DBRef, SON, ObjectId
|
from bson import Binary, DBRef, SON, ObjectId
|
||||||
|
|
||||||
from base import (BaseField, ComplexBaseField, ObjectIdField,
|
from base import (BaseField, ComplexBaseField, ObjectIdField,
|
||||||
ValidationError, get_document)
|
ValidationError, get_document, BaseDocument)
|
||||||
from queryset import DO_NOTHING, QuerySet
|
from queryset import DO_NOTHING, QuerySet
|
||||||
from document import Document, EmbeddedDocument
|
from document import Document, EmbeddedDocument
|
||||||
from connection import get_db, DEFAULT_CONNECTION_NAME
|
from connection import get_db, DEFAULT_CONNECTION_NAME
|
||||||
|
|
@ -497,6 +497,7 @@ class ListField(ComplexBaseField):
|
||||||
def prepare_query_value(self, op, value):
|
def prepare_query_value(self, op, value):
|
||||||
if self.field:
|
if self.field:
|
||||||
if op in ('set', 'unset') and (not isinstance(value, basestring)
|
if op in ('set', 'unset') and (not isinstance(value, basestring)
|
||||||
|
and not isinstance(value, BaseDocument)
|
||||||
and hasattr(value, '__iter__')):
|
and hasattr(value, '__iter__')):
|
||||||
return [self.field.prepare_query_value(op, v) for v in value]
|
return [self.field.prepare_query_value(op, v) for v in value]
|
||||||
return self.field.prepare_query_value(op, value)
|
return self.field.prepare_query_value(op, value)
|
||||||
|
|
|
||||||
1
requirements.txt
Normal file
1
requirements.txt
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
pymongo
|
||||||
Loading…
Add table
Add a link
Reference in a new issue