diff options
| author | Alex | 2013-11-12 23:40:24 +0000 |
|---|---|---|
| committer | Alex | 2013-11-12 23:40:24 +0000 |
| commit | 5136798a040fc306a37b562c7cd629ab34bc02e3 (patch) | |
| tree | ae51dec9e5ee4bcebbd22d1383602d66f06a996b /rest_framework/mixins.py | |
| parent | d1dc68d7550e90ba56a3122f8de1f38bb5aa1e3a (diff) | |
| parent | 8552e79d7b62ca7f0edd131d3049ca220d879d48 (diff) | |
| download | django-rest-framework-5136798a040fc306a37b562c7cd629ab34bc02e3.tar.bz2 | |
Merge branch 'master' into allow-aggregate-ordering
Diffstat (limited to 'rest_framework/mixins.py')
| -rw-r--r-- | rest_framework/mixins.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/rest_framework/mixins.py b/rest_framework/mixins.py index 426865ff..4606c78b 100644 --- a/rest_framework/mixins.py +++ b/rest_framework/mixins.py @@ -158,7 +158,8 @@ class UpdateModelMixin(object): Set any attributes on the object that are implicit in the request. """ # pk and/or slug attributes are implicit in the URL. - lookup = self.kwargs.get(self.lookup_field, None) + lookup_url_kwarg = self.lookup_url_kwarg or self.lookup_field + lookup = self.kwargs.get(lookup_url_kwarg, None) pk = self.kwargs.get(self.pk_url_kwarg, None) slug = self.kwargs.get(self.slug_url_kwarg, None) slug_field = slug and self.slug_field or None |
