Fix HyperlinkedModelSerializer not respecting lookup_fields

This commit is contained in:
Tom Christie 2013-05-09 17:09:40 +01:00
parent 939cc5adba
commit 0176a5391b

View File

@ -827,7 +827,7 @@ class HyperlinkedModelSerializerOptions(ModelSerializerOptions):
def __init__(self, meta): def __init__(self, meta):
super(HyperlinkedModelSerializerOptions, self).__init__(meta) super(HyperlinkedModelSerializerOptions, self).__init__(meta)
self.view_name = getattr(meta, 'view_name', None) self.view_name = getattr(meta, 'view_name', None)
self.lookup_field = getattr(meta, 'slug_field', None) self.lookup_field = getattr(meta, 'lookup_field', None)
class HyperlinkedModelSerializer(ModelSerializer): class HyperlinkedModelSerializer(ModelSerializer):