parent
89220c142b
commit
7ca2ea0766
@ -4,6 +4,8 @@ Changelog
|
|||||||
|
|
||||||
Changes in 0.6.X
|
Changes in 0.6.X
|
||||||
================
|
================
|
||||||
|
- Fixed .save() _delta issue with DbRefs
|
||||||
|
- Fixed Django TestCase
|
||||||
- Added cmp to Embedded Document
|
- Added cmp to Embedded Document
|
||||||
- Added PULL reverse_delete_rule
|
- Added PULL reverse_delete_rule
|
||||||
- Fixed CASCADE delete bug
|
- Fixed CASCADE delete bug
|
||||||
@ -317,4 +319,4 @@ Changes in v0.1.2
|
|||||||
|
|
||||||
Changes in v0.1.1
|
Changes in v0.1.1
|
||||||
=================
|
=================
|
||||||
- Documents may now use capped collections
|
-
|
@ -1050,14 +1050,18 @@ Invalid data to create a `%s` instance.\n%s""".strip() % (cls._class_name, error
|
|||||||
for path in set_fields:
|
for path in set_fields:
|
||||||
parts = path.split('.')
|
parts = path.split('.')
|
||||||
d = doc
|
d = doc
|
||||||
|
dbref = False
|
||||||
for p in parts:
|
for p in parts:
|
||||||
if hasattr(d, '__getattr__'):
|
if isinstance(d, DBRef):
|
||||||
|
dbref = True
|
||||||
|
elif hasattr(d, '__getattr__'):
|
||||||
d = getattr(p, d)
|
d = getattr(p, d)
|
||||||
elif p.isdigit():
|
elif p.isdigit():
|
||||||
d = d[int(p)]
|
d = d[int(p)]
|
||||||
else:
|
else:
|
||||||
d = d.get(p)
|
d = d.get(p)
|
||||||
set_data[path] = d
|
if not dbref:
|
||||||
|
set_data[path] = d
|
||||||
else:
|
else:
|
||||||
set_data = doc
|
set_data = doc
|
||||||
if '_id' in set_data:
|
if '_id' in set_data:
|
||||||
|
@ -114,7 +114,7 @@ class DeReference(object):
|
|||||||
doc = get_document(ref["_cls"])._from_son(ref)
|
doc = get_document(ref["_cls"])._from_son(ref)
|
||||||
elif doc_type is None:
|
elif doc_type is None:
|
||||||
doc = get_document(
|
doc = get_document(
|
||||||
''.join(x.capitalize()
|
''.join(x.capitalize()
|
||||||
for x in col.split('_')))._from_son(ref)
|
for x in col.split('_')))._from_son(ref)
|
||||||
else:
|
else:
|
||||||
doc = doc_type._from_son(ref)
|
doc = doc_type._from_son(ref)
|
||||||
|
@ -4,9 +4,10 @@ test = nosetests
|
|||||||
[nosetests]
|
[nosetests]
|
||||||
verbosity = 2
|
verbosity = 2
|
||||||
detailed-errors = 1
|
detailed-errors = 1
|
||||||
with-coverage = 1
|
#with-coverage = 1
|
||||||
#cover-html = 1
|
cover-html = 1
|
||||||
#cover-html-dir = ../htmlcov
|
cover-html-dir = ../htmlcov
|
||||||
cover-package = mongoengine
|
cover-package = mongoengine
|
||||||
cover-erase = 1
|
cover-erase = 1
|
||||||
where = tests
|
where = tests
|
||||||
|
#tests = test_bugfix.py
|
||||||
|
Loading…
x
Reference in New Issue
Block a user