Commit 9cd455a5 by Tom Christie

Merge pull request #3206 from Ian-Foote/patch-1

Fix custom HyperlinkedRelatedField example
parents a543fae1 ed55fbe8
...@@ -498,10 +498,10 @@ For example, if all your object URLs used both a account and a slug in the the U ...@@ -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} kwargs = {'account': obj.account, 'slug': obj.slug}
return reverse(view_name, kwargs=kwargs, request=request, format=format) 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'] account = view_kwargs['account']
slug = view_kwargs['slug'] slug = view_kwargs['slug']
return queryset.get(account=account, slug=slug) return self.get_queryset().get(account=account, slug=slug)
--- ---
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment