fixes for #315 issue
This commit is contained in:
parent
76d771d20f
commit
3d817f145c
3 changed files with 11 additions and 11 deletions
|
|
@ -739,16 +739,6 @@ class BaseDocument(object):
|
||||||
elif field.required:
|
elif field.required:
|
||||||
raise ValidationError('Field "%s" is required' % field.name)
|
raise ValidationError('Field "%s" is required' % field.name)
|
||||||
|
|
||||||
@apply
|
|
||||||
def pk():
|
|
||||||
"""Primary key alias
|
|
||||||
"""
|
|
||||||
def fget(self):
|
|
||||||
return getattr(self, self._meta['id_field'])
|
|
||||||
def fset(self, value):
|
|
||||||
return setattr(self, self._meta['id_field'], value)
|
|
||||||
return property(fget, fset)
|
|
||||||
|
|
||||||
def to_mongo(self):
|
def to_mongo(self):
|
||||||
"""Return data dictionary ready for use with MongoDB.
|
"""Return data dictionary ready for use with MongoDB.
|
||||||
"""
|
"""
|
||||||
|
|
|
||||||
|
|
@ -76,6 +76,16 @@ class Document(BaseDocument):
|
||||||
by setting index_types to False on the meta dictionary for the document.
|
by setting index_types to False on the meta dictionary for the document.
|
||||||
"""
|
"""
|
||||||
__metaclass__ = TopLevelDocumentMetaclass
|
__metaclass__ = TopLevelDocumentMetaclass
|
||||||
|
|
||||||
|
@apply
|
||||||
|
def pk():
|
||||||
|
"""Primary key alias
|
||||||
|
"""
|
||||||
|
def fget(self):
|
||||||
|
return getattr(self, self._meta['id_field'])
|
||||||
|
def fset(self, value):
|
||||||
|
return setattr(self, self._meta['id_field'], value)
|
||||||
|
return property(fget, fset)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def _get_collection(self):
|
def _get_collection(self):
|
||||||
|
|
|
||||||
2
setup.py
2
setup.py
|
|
@ -47,5 +47,5 @@ setup(name='mongoengine',
|
||||||
classifiers=CLASSIFIERS,
|
classifiers=CLASSIFIERS,
|
||||||
install_requires=['pymongo'],
|
install_requires=['pymongo'],
|
||||||
test_suite='tests',
|
test_suite='tests',
|
||||||
tests_require=['blinker', 'django==1.3']
|
tests_require=['blinker', 'django>=1.3']
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue