diff options
| author | Tom Christie | 2013-04-29 13:20:15 +0100 |
|---|---|---|
| committer | Tom Christie | 2013-04-29 13:20:15 +0100 |
| commit | 53f9d4a380ee0066cbee8382ae265ea6005d8c88 (patch) | |
| tree | b209933584df66f8093a665921fb65b90726eed1 /rest_framework/serializers.py | |
| parent | d17e2d852fc6ebc738e324b8797d390dc0287d37 (diff) | |
| download | django-rest-framework-53f9d4a380ee0066cbee8382ae265ea6005d8c88.tar.bz2 | |
fields shortcut on views
Diffstat (limited to 'rest_framework/serializers.py')
| -rw-r--r-- | rest_framework/serializers.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/rest_framework/serializers.py b/rest_framework/serializers.py index 3afb7475..f4a20097 100644 --- a/rest_framework/serializers.py +++ b/rest_framework/serializers.py @@ -645,7 +645,7 @@ class ModelSerializer(Serializer): for relation in reverse_rels: accessor_name = relation.get_accessor_name() - if accessor_name not in self.opts.fields: + if not self.opts.fields or accessor_name not in self.opts.fields: continue related_model = relation.model to_many = relation.field.rel.multiple |
