Changed the inheritance model to remove types

The inheritance model has changed, we no longer need to store an array of
`types` with the model we can just use the classname in `_cls`.

See the upgrade docs for information on how to upgrade
MongoEngine/mongoengine#148
This commit is contained in:
Ross Lawley
2012-10-09 15:02:13 +00:00
parent 31ec7907b5
commit 6f29d12386
40 changed files with 4856 additions and 4622 deletions

View File

@@ -12,10 +12,11 @@ from operator import itemgetter
import gridfs
from bson import Binary, DBRef, SON, ObjectId
from mongoengine.errors import ValidationError
from mongoengine.python_support import (PY3, bin_type, txt_type,
str_types, StringIO)
from base import (BaseField, ComplexBaseField, ObjectIdField,
ValidationError, get_document, BaseDocument)
get_document, BaseDocument)
from queryset import DO_NOTHING, QuerySet
from document import Document, EmbeddedDocument
from connection import get_db, DEFAULT_CONNECTION_NAME
@@ -568,9 +569,6 @@ class ListField(ComplexBaseField):
Required means it cannot be empty - as the default for ListFields is []
"""
# ListFields cannot be indexed with _types - MongoDB doesn't support this
_index_with_types = False
def __init__(self, field=None, **kwargs):
self.field = field
kwargs.setdefault('default', lambda: [])