mirror of
https://github.com/django/django.git
synced 2025-03-26 09:10:50 +00:00
Removed duplicate opts.pk_index() method
This commit is contained in:
parent
86644e065f
commit
d37483c533
@ -176,8 +176,10 @@ class Options(object):
|
|||||||
field.serialize = False
|
field.serialize = False
|
||||||
|
|
||||||
def pk_index(self):
|
def pk_index(self):
|
||||||
return [pos for pos, field in enumerate(self.fields)
|
"""
|
||||||
if field == self.pk][0]
|
Returns the index of the primary key field in the self.fields list.
|
||||||
|
"""
|
||||||
|
return self.fields.index(self.pk)
|
||||||
|
|
||||||
def setup_proxy(self, target):
|
def setup_proxy(self, target):
|
||||||
"""
|
"""
|
||||||
@ -518,9 +520,3 @@ class Options(object):
|
|||||||
# objects.append(opts)
|
# objects.append(opts)
|
||||||
self._ordered_objects = objects
|
self._ordered_objects = objects
|
||||||
return self._ordered_objects
|
return self._ordered_objects
|
||||||
|
|
||||||
def pk_index(self):
|
|
||||||
"""
|
|
||||||
Returns the index of the primary key field in the self.fields list.
|
|
||||||
"""
|
|
||||||
return self.fields.index(self.pk)
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user