mirror of
https://github.com/django/django.git
synced 2025-07-19 09:09:13 +00:00
[1.0.X] Fixed a breakage with ManyToManyFields in admin caused by r10140. Refs #9994.
Merge of r10170 from trunk. git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@10173 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
dce8fdbc68
commit
2e05920401
@ -637,6 +637,14 @@ class ManyToManyRel(object):
|
|||||||
self.multiple = True
|
self.multiple = True
|
||||||
self.through = through
|
self.through = through
|
||||||
|
|
||||||
|
def get_related_field(self):
|
||||||
|
"""
|
||||||
|
Returns the field in the to' object to which this relationship is tied
|
||||||
|
(this is always the primary key on the target model). Provided for
|
||||||
|
symmetry with ManyToOneRel.
|
||||||
|
"""
|
||||||
|
return self.to._meta.pk
|
||||||
|
|
||||||
class ForeignKey(RelatedField, Field):
|
class ForeignKey(RelatedField, Field):
|
||||||
empty_strings_allowed = False
|
empty_strings_allowed = False
|
||||||
def __init__(self, to, to_field=None, rel_class=ManyToOneRel, **kwargs):
|
def __init__(self, to, to_field=None, rel_class=ManyToOneRel, **kwargs):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user