Drop implicit 'pk' on last arg in urlconf. (Too magical).

This commit is contained in:
Tom Christie 2012-01-28 19:06:40 +00:00
parent 765ec0b76e
commit c0674e36d4

View File

@ -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):