Skip to content

Commit 95d57e6

Browse files
committed
Merge pull request #2182 from sh4r3m4n/master
Updated serializers documentation
2 parents 2123685 + 5ad22ae commit 95d57e6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/api-guide/serializers.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -567,13 +567,13 @@ There needs to be a way of determining which views should be used for hyperlinki
567567

568568
By default hyperlinks are expected to correspond to a view name that matches the style `'{model_name}-detail'`, and looks up the instance by a `pk` keyword argument.
569569

570-
You can override a URL field view name and lookup field by using either, or both of, the `view_name` and `lookup_field` options in the `extra_field_kwargs` setting, like so:
570+
You can override a URL field view name and lookup field by using either, or both of, the `view_name` and `lookup_field` options in the `extra_kwargs` setting, like so:
571571

572572
class AccountSerializer(serializers.HyperlinkedModelSerializer):
573573
class Meta:
574574
model = Account
575575
fields = ('account_url', 'account_name', 'users', 'created')
576-
extra_field_kwargs = {
576+
extra_kwargs = {
577577
'url': {'view_name': 'accounts', 'lookup_field': 'account_name'}
578578
'users': {'lookup_field': 'username'}
579579
}

0 commit comments

Comments
 (0)