From d37483c533868e78afd0ca3faf993fee97097f9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anssi=20K=C3=A4=C3=A4ri=C3=A4inen?= Date: Tue, 27 Nov 2012 21:54:46 +0200 Subject: [PATCH] Removed duplicate opts.pk_index() method --- django/db/models/options.py | 12 ++++-------- 1 file 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)