From ed55fbe8626494a12860cf582972800e75c3b500 Mon Sep 17 00:00:00 2001 From: Ian Foote Date: Fri, 31 Jul 2015 12:59:50 +0100 Subject: [PATCH] Fix custom HyperlinkedRelatedField example Fix `get_object` method signature to match [`HyperlinkedRelatedField.get_object`](https://github.com/tomchristie/django-rest-framework/blob/master/rest_framework/relations.py#L227-L236). --- docs/api-guide/relations.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/api-guide/relations.md b/docs/api-guide/relations.md index a673c2fcc..47d5ab2e3 100644 --- a/docs/api-guide/relations.md +++ b/docs/api-guide/relations.md @@ -498,10 +498,10 @@ For example, if all your object URLs used both a account and a slug in the the U kwargs = {'account': obj.account, 'slug': obj.slug} return reverse(view_name, kwargs=kwargs, request=request, format=format) - def get_object(self, queryset, view_name, view_args, view_kwargs): + def get_object(self, view_name, view_args, view_kwargs): account = view_kwargs['account'] slug = view_kwargs['slug'] - return queryset.get(account=account, slug=slug) + return self.get_queryset().get(account=account, slug=slug) ---