parent
4f5aa8c43b
commit
34d08ce8ef
1 changed files with 4 additions and 2 deletions
|
|
@ -267,8 +267,10 @@ class ComplexBaseField(BaseField):
|
||||||
if instance is None:
|
if instance is None:
|
||||||
# Document class being used rather than a document object
|
# Document class being used rather than a document object
|
||||||
return self
|
return self
|
||||||
|
from fields import GenericReferenceField, ReferenceField
|
||||||
if not self._dereference and instance._initialised:
|
dereference = self.field is None or isinstance(self.field,
|
||||||
|
(GenericReferenceField, ReferenceField))
|
||||||
|
if not self._dereference and instance._initialised and dereference:
|
||||||
from dereference import DeReference
|
from dereference import DeReference
|
||||||
self._dereference = DeReference() # Cached
|
self._dereference = DeReference() # Cached
|
||||||
instance._data[self.name] = self._dereference(
|
instance._data[self.name] = self._dereference(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue