Permalink
Browse files

[1.5.x] Removed duplicate opts.pk_index() method

Backpatch of [d37483c]
  • Loading branch information...
akaariai committed Nov 27, 2012
1 parent 71e5ad2 commit 4467d86b61e47f4c9dcb130865a6700736500b4a
Showing with 4 additions and 8 deletions.
  1. +4 −8 django/db/models/options.py
@@ -194,8 +194,10 @@ def setup_pk(self, field):
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 @@ def get_ordered_objects(self):
# 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)

0 comments on commit 4467d86

Please sign in to comment.