Use weakref proxies in base lists / dicts (MongoEngine/mongoengine#74)
This commit is contained in:
parent
0454fc74e9
commit
9e67941bad
@ -4,6 +4,7 @@ Changelog
|
|||||||
|
|
||||||
Changes in 0.7.X
|
Changes in 0.7.X
|
||||||
=================
|
=================
|
||||||
|
- Use weakref proxies in base lists / dicts (MongoEngine/mongoengine#74)
|
||||||
- Improved queryset filtering (hmarr/mongoengine#554)
|
- Improved queryset filtering (hmarr/mongoengine#554)
|
||||||
- Fixed Dynamic Documents and Embedded Documents (hmarr/mongoengine#561)
|
- Fixed Dynamic Documents and Embedded Documents (hmarr/mongoengine#561)
|
||||||
- Fixed abstract classes and shard keys (MongoEngine/mongoengine#64)
|
- Fixed abstract classes and shard keys (MongoEngine/mongoengine#64)
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import operator
|
import operator
|
||||||
import sys
|
import sys
|
||||||
import warnings
|
import warnings
|
||||||
|
import weakref
|
||||||
|
|
||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
from functools import partial
|
from functools import partial
|
||||||
@ -1265,7 +1266,7 @@ class BaseList(list):
|
|||||||
_name = None
|
_name = None
|
||||||
|
|
||||||
def __init__(self, list_items, instance, name):
|
def __init__(self, list_items, instance, name):
|
||||||
self._instance = instance
|
self._instance = weakref.proxy(instance)
|
||||||
self._name = name
|
self._name = name
|
||||||
return super(BaseList, self).__init__(list_items)
|
return super(BaseList, self).__init__(list_items)
|
||||||
|
|
||||||
@ -1327,7 +1328,7 @@ class BaseDict(dict):
|
|||||||
_name = None
|
_name = None
|
||||||
|
|
||||||
def __init__(self, dict_items, instance, name):
|
def __init__(self, dict_items, instance, name):
|
||||||
self._instance = instance
|
self._instance = weakref.proxy(instance)
|
||||||
self._name = name
|
self._name = name
|
||||||
return super(BaseDict, self).__init__(dict_items)
|
return super(BaseDict, self).__init__(dict_items)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user