Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Removed duplicate opts.pk_index() method

  • Loading branch information...
commit d37483c533868e78afd0ca3faf993fee97097f9f 1 parent 86644e0
@akaariai akaariai authored
Showing with 4 additions and 8 deletions.
  1. +4 −8 django/db/models/options.py
View
12 django/db/models/options.py
@@ -176,8 +176,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):
"""
@@ -518,9 +520,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)
Please sign in to comment.
Something went wrong with that request. Please try again.