mirror of
https://github.com/django/django.git
synced 2025-04-19 23:04:36 +00:00
[1.5.x] Removed duplicate opts.pk_index() method
Backpatch of [d37483c533868e78afd0ca3faf993fee97097f9f]
This commit is contained in:
parent
71e5ad248e
commit
4467d86b61
@ -194,8 +194,10 @@ class Options(object):
|
||||
field.serialize = False
|
||||
|
||||
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):
|
||||
"""
|
||||
@ -537,9 +539,3 @@ class Options(object):
|
||||
# objects.append(opts)
|
||||
self._ordered_objects = 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