aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Christie2014-12-02 15:27:06 +0000
committerTom Christie2014-12-02 15:27:06 +0000
commit95d57e6dace94794d6283cda0676d745057893b6 (patch)
tree9f0ec0621000546f845fe8111f497e137e85bdea
parent21236854539acef81d1eac3da707b711b4c31a0f (diff)
parent5ad22aea605f888e06186d907674669c46a611ef (diff)
downloaddjango-rest-framework-95d57e6dace94794d6283cda0676d745057893b6.tar.bz2
Merge pull request #2182 from sh4r3m4n/master
Updated serializers documentation
-rw-r--r--docs/api-guide/serializers.md4
1 files changed, 2 insertions, 2 deletions
diff --git a/docs/api-guide/serializers.md b/docs/api-guide/serializers.md
index a011bb52..1779c863 100644
--- a/docs/api-guide/serializers.md
+++ b/docs/api-guide/serializers.md
@@ -567,13 +567,13 @@ There needs to be a way of determining which views should be used for hyperlinki
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.
-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:
+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:
class AccountSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Account
fields = ('account_url', 'account_name', 'users', 'created')
- extra_field_kwargs = {
+ extra_kwargs = {
'url': {'view_name': 'accounts', 'lookup_field': 'account_name'}
'users': {'lookup_field': 'username'}
}