diff options
| author | Jacek Bzdak | 2013-10-22 13:13:01 +0200 |
|---|---|---|
| committer | Jacek Bzdak | 2013-10-22 13:13:01 +0200 |
| commit | 8fffc346c1c4fe6e634ce60bd0371217b07ecf5c (patch) | |
| tree | d9f52a4b886d574039cdcffd72266df49c1b6a8c /rest_framework/mixins.py | |
| parent | 25c9d552c05527f4b8b257d59cd7be39005f3668 (diff) | |
| parent | fa87fac61b87858e80788fc233591fa11dbc18e7 (diff) | |
| download | django-rest-framework-8fffc346c1c4fe6e634ce60bd0371217b07ecf5c.tar.bz2 | |
Merge remote-tracking branch 'origin/master'
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 |
