summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnssi Kääriäinen <akaariai@gmail.com>2012-11-27 21:54:46 +0200
committerAnssi Kääriäinen <akaariai@gmail.com>2012-11-27 21:59:03 +0200
commit4467d86b61e47f4c9dcb130865a6700736500b4a (patch)
treebd502682804ccaee2a967006922eb9556051ee0e
parent71e5ad248e104f68a0d755cd5f76e86631607be5 (diff)
[1.5.x] Removed duplicate opts.pk_index() method
Backpatch of [d37483c533868e78afd0ca3faf993fee97097f9f]
-rw-r--r--django/db/models/options.py12
1 files changed, 4 insertions, 8 deletions
diff --git a/django/db/models/options.py b/django/db/models/options.py
index 826d773faa..b5d8b1bb9a 100644
--- a/django/db/models/options.py
+++ b/django/db/models/options.py
@@ -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)