Rename _.meta.virtual_fields to privat_fields

This commit is contained in:
Marc Aymerich 2016-11-15 09:05:16 +00:00
parent 1c870de0f6
commit e033fe3865
2 changed files with 3 additions and 3 deletions

View File

@ -12,7 +12,7 @@ def get_related_object(origin, max_depth=2):
a use-case calls for it. a use-case calls for it.
""" """
def related_iterator(node): def related_iterator(node):
for field in node._meta.virtual_fields: for field in node._meta.private_fields:
if hasattr(field, 'ct_field'): if hasattr(field, 'ct_field'):
yield getattr(node, field.name) yield getattr(node, field.name)
for field in node._meta.fields: for field in node._meta.fields:

View File

@ -341,8 +341,8 @@ def create_resource_relation():
except AttributeError: except AttributeError:
pass pass
else: else:
related._meta.virtual_fields = [ related._meta.private_fields = [
field for field in related._meta.virtual_fields if field.rel.to != ResourceData field for field in related._meta.private_fields if field.rel.to != ResourceData
] ]
for ct, resources in Resource.objects.group_by('content_type').items(): for ct, resources in Resource.objects.group_by('content_type').items():