aboutsummaryrefslogtreecommitdiffstats
path: root/docs/api-guide/status-codes.md
diff options
context:
space:
mode:
authorStephan Groß2012-10-31 15:30:01 +0100
committerStephan Groß2012-10-31 15:30:01 +0100
commitff7725f05e8ca624e54d707f7c655e3d5c8b8888 (patch)
treeca01f596ac1bc41ac320b3915754dd742cc8dda2 /docs/api-guide/status-codes.md
parentde2ef5d9c24171eb6b945b7822eac809c099fec9 (diff)
downloaddjango-rest-framework-ff7725f05e8ca624e54d707f7c655e3d5c8b8888.tar.bz2
added support for custom slug field and kwargs
without subclassing HyperlinkedRelatedField and overwriting slug_url_kwarg and slug_field there is no possibility to use other fields / arguments. now you can do something like this: url(r'^users/(?P<username>\w[\w-]*)$', UserInstance.as_view(), name='user-detail') class ProjectSerializer(serializers.HyperlinkedModelSerializer): created_by = serializers.HyperlinkedRelatedField(view_name='user-detail', slug_url_kwargs='username', slug_field='username')
Diffstat (limited to 'docs/api-guide/status-codes.md')
0 files changed, 0 insertions, 0 deletions