Merge branch 'master' into dev

Conflicts:
	AUTHORS
	docs/changelog.rst
	mongoengine/base.py
This commit is contained in:
Ross Lawley 2011-10-12 00:35:01 -07:00
commit 76d771d20f
4 changed files with 11 additions and 6 deletions

View File

@ -71,3 +71,4 @@ that much better:
* Paul Aliagas * Paul Aliagas
* Paul Cunnane * Paul Cunnane
* Julien Rebetez * Julien Rebetez

View File

@ -2,12 +2,10 @@
Changelog Changelog
========= =========
Changes in dev Changes in dev
============== ==============
- Fixed calling a queryset after drop_collection now recreates the collection - Fixed calling a queryset after drop_collection now recreates the collection
- Fixed tree based circular reference bug
- Add field name to validation exception messages - Add field name to validation exception messages
- Added UUID field - Added UUID field
- Improved efficiency of .get() - Improved efficiency of .get()
@ -16,6 +14,12 @@ Changes in dev
- Fixed ListField so it doesnt accept strings - Fixed ListField so it doesnt accept strings
- Added DynamicDocument and EmbeddedDynamicDocument classes for expando schemas - Added DynamicDocument and EmbeddedDynamicDocument classes for expando schemas
Changes in v0.5.2
=================
- A Robust Circular reference bugfix
Changes in v0.5.1 Changes in v0.5.1
================= =================

View File

@ -14,7 +14,7 @@ __all__ = (document.__all__ + fields.__all__ + connection.__all__ +
__author__ = 'Harry Marr' __author__ = 'Harry Marr'
VERSION = (0, 5, 1) VERSION = (0, 5, 2)
def get_version(): def get_version():

View File

@ -848,11 +848,11 @@ class BaseDocument(object):
_changed_fields = [] _changed_fields = []
_changed_fields += getattr(self, '_changed_fields', []) _changed_fields += getattr(self, '_changed_fields', [])
inspected = inspected or [] inspected = inspected or set()
if hasattr(self, 'id'): if hasattr(self, 'id'):
if self.id in inspected: if self.id in inspected:
return _changed_fields return _changed_fields
inspected.append(self.id) inspected.add(self.id)
field_list = self._fields.copy() field_list = self._fields.copy()
if self._dynamic: if self._dynamic:
@ -865,7 +865,7 @@ class BaseDocument(object):
if hasattr(field, 'id'): if hasattr(field, 'id'):
if field.id in inspected: if field.id in inspected:
continue continue
inspected.append(field.id) inspected.add(field.id)
if isinstance(field, (EmbeddedDocument, DynamicEmbeddedDocument)) and db_field_name not in _changed_fields: # Grab all embedded fields that have been changed if isinstance(field, (EmbeddedDocument, DynamicEmbeddedDocument)) and db_field_name not in _changed_fields: # Grab all embedded fields that have been changed
_changed_fields += ["%s%s" % (key, k) for k in field._get_changed_fields(key, inspected) if k] _changed_fields += ["%s%s" % (key, k) for k in field._get_changed_fields(key, inspected) if k]