fix-#914: ListField of embedded docs doesn't set the _instance attribute when iterating over it

This commit is contained in:
David Bordeynik
2015-04-02 08:59:24 +03:00
parent 1001f1bd36
commit bb77838b3e
3 changed files with 21 additions and 0 deletions
+4
View File
@@ -125,6 +125,10 @@ class BaseList(list):
value._instance = self._instance
return value
def __iter__(self):
for i in xrange(self.__len__()):
yield self[i]
def __setitem__(self, key, value, *args, **kwargs):
if isinstance(key, slice):
self._mark_as_changed()