mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-02-25 07:50:41 +03:00
Drop implicit 'pk' on last arg in urlconf. (Too magical).
This commit is contained in:
parent
765ec0b76e
commit
c0674e36d4
|
@ -507,11 +507,6 @@ class ModelMixin(object):
|
||||||
if BaseRenderer._FORMAT_QUERY_PARAM in tmp:
|
if BaseRenderer._FORMAT_QUERY_PARAM in tmp:
|
||||||
del tmp[BaseRenderer._FORMAT_QUERY_PARAM]
|
del tmp[BaseRenderer._FORMAT_QUERY_PARAM]
|
||||||
|
|
||||||
if args:
|
|
||||||
# If we have any no kwargs then assume the last arg represents the
|
|
||||||
# primrary key. Otherwise assume the kwargs uniquely identify the
|
|
||||||
# model.
|
|
||||||
tmp.update({'pk': args[-1]})
|
|
||||||
return Q(**tmp)
|
return Q(**tmp)
|
||||||
|
|
||||||
def get_instance_data(self, model, content, **kwargs):
|
def get_instance_data(self, model, content, **kwargs):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user