base no longer expects meta to have allow_inheritance

Closes #430 #431
This commit is contained in:
Ross Lawley 2012-02-17 09:41:01 +00:00
parent 0301135f96
commit df65f3fc3f
2 changed files with 3 additions and 2 deletions

View File

@ -95,3 +95,4 @@ that much better:
* Chris Faulkner * Chris Faulkner
* Ashwin Purohit * Ashwin Purohit
* Shalabh Aggarwal * Shalabh Aggarwal
* Chris Williams

View File

@ -339,7 +339,7 @@ class ComplexBaseField(BaseField):
# _types / _cls data so make it a generic reference allows # _types / _cls data so make it a generic reference allows
# us to dereference # us to dereference
meta = getattr(v, 'meta', getattr(v, '_meta', {})) meta = getattr(v, 'meta', getattr(v, '_meta', {}))
if meta and not meta['allow_inheritance'] and not self.field: if meta and not meta.get('allow_inheritance', True) and not self.field:
from fields import GenericReferenceField from fields import GenericReferenceField
value_dict[k] = GenericReferenceField().to_mongo(v) value_dict[k] = GenericReferenceField().to_mongo(v)
else: else: