mirror of
https://github.com/django/django.git
synced 2025-10-07 17:20:48 +00:00
Fixed ._meta.pk_index() virtual field failure
This commit is contained in:
parent
dab52d99fc
commit
92476e880c
3 changed files with 23 additions and 3 deletions
|
@ -204,9 +204,10 @@ class Options(object):
|
|||
|
||||
def pk_index(self):
|
||||
"""
|
||||
Returns the index of the primary key field in the self.fields list.
|
||||
Returns the index of the primary key field in the self.concrete_fields
|
||||
list.
|
||||
"""
|
||||
return self.fields.index(self.pk)
|
||||
return self.concrete_fields.index(self.pk)
|
||||
|
||||
def setup_proxy(self, target):
|
||||
"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue