mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-29 21:14:01 +03:00
Fix 'lookup_field' on ModelSerializer. Closes #1944.
This commit is contained in:
parent
826b5a8897
commit
e272a36c9b
|
@ -680,7 +680,7 @@ class ModelSerializer(Serializer):
|
||||||
PendingDeprecationWarning,
|
PendingDeprecationWarning,
|
||||||
stacklevel=3
|
stacklevel=3
|
||||||
)
|
)
|
||||||
kwargs = extra_kwargs.get(field_name, {})
|
kwargs = extra_kwargs.get(api_settings.URL_FIELD_NAME, {})
|
||||||
kwargs['view_name'] = view_name
|
kwargs['view_name'] = view_name
|
||||||
extra_kwargs[api_settings.URL_FIELD_NAME] = kwargs
|
extra_kwargs[api_settings.URL_FIELD_NAME] = kwargs
|
||||||
|
|
||||||
|
@ -692,7 +692,7 @@ class ModelSerializer(Serializer):
|
||||||
PendingDeprecationWarning,
|
PendingDeprecationWarning,
|
||||||
stacklevel=3
|
stacklevel=3
|
||||||
)
|
)
|
||||||
kwargs = extra_kwargs.get(field_name, {})
|
kwargs = extra_kwargs.get(api_settings.URL_FIELD_NAME, {})
|
||||||
kwargs['lookup_field'] = lookup_field
|
kwargs['lookup_field'] = lookup_field
|
||||||
extra_kwargs[api_settings.URL_FIELD_NAME] = kwargs
|
extra_kwargs[api_settings.URL_FIELD_NAME] = kwargs
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user