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:54:46 +0200
commitd37483c533868e78afd0ca3faf993fee97097f9f (patch)
tree00eab739d0a3f4e23c58da124dd1b4ae6a982e70
parent86644e065fbde410aa32e052e206d1c53a916fd3 (diff)
Removed duplicate opts.pk_index() method
-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 ab2f44e2f7..4c8dfd83c5 100644
--- a/django/db/models/options.py
+++ b/django/db/models/options.py
@@ -176,8 +176,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):
"""
@@ -518,9 +520,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)