diff options
| author | Tom Christie | 2014-12-19 21:32:43 +0000 | 
|---|---|---|
| committer | Tom Christie | 2014-12-19 21:32:43 +0000 | 
| commit | 2a1485e00943b8280245d19e1e1f8514b1ef18ea (patch) | |
| tree | 6b0a43326c6541662862de2b21d290c8c0b86007 /rest_framework/utils | |
| parent | 48d15f6ff8a13aafd5b4977c8d1b4b7fe70b4f6a (diff) | |
| download | django-rest-framework-2a1485e00943b8280245d19e1e1f8514b1ef18ea.tar.bz2 | |
Final bits of docs for ModelSerializer fields APImodel-serializer-api
Diffstat (limited to 'rest_framework/utils')
| -rw-r--r-- | rest_framework/utils/model_meta.py | 10 | 
1 files changed, 5 insertions, 5 deletions
| diff --git a/rest_framework/utils/model_meta.py b/rest_framework/utils/model_meta.py index c98725c6..dfc387ca 100644 --- a/rest_framework/utils/model_meta.py +++ b/rest_framework/utils/model_meta.py @@ -24,7 +24,7 @@ FieldInfo = namedtuple('FieldResult', [  RelationInfo = namedtuple('RelationInfo', [      'model_field', -    'related', +    'related_model',      'to_many',      'has_through_model'  ]) @@ -77,7 +77,7 @@ def get_field_info(model):      for field in [field for field in opts.fields if field.serialize and field.rel]:          forward_relations[field.name] = RelationInfo(              model_field=field, -            related=_resolve_model(field.rel.to), +            related_model=_resolve_model(field.rel.to),              to_many=False,              has_through_model=False          ) @@ -86,7 +86,7 @@ def get_field_info(model):      for field in [field for field in opts.many_to_many if field.serialize]:          forward_relations[field.name] = RelationInfo(              model_field=field, -            related=_resolve_model(field.rel.to), +            related_model=_resolve_model(field.rel.to),              to_many=True,              has_through_model=(                  not field.rel.through._meta.auto_created @@ -99,7 +99,7 @@ def get_field_info(model):          accessor_name = relation.get_accessor_name()          reverse_relations[accessor_name] = RelationInfo(              model_field=None, -            related=relation.model, +            related_model=relation.model,              to_many=relation.field.rel.multiple,              has_through_model=False          ) @@ -109,7 +109,7 @@ def get_field_info(model):          accessor_name = relation.get_accessor_name()          reverse_relations[accessor_name] = RelationInfo(              model_field=None, -            related=relation.model, +            related_model=relation.model,              to_many=True,              has_through_model=(                  (getattr(relation.field.rel, 'through', None) is not None) | 
