Kaydet (Commit) 6671b8b1 authored tarafından Malcolm Tredinnick's avatar Malcolm Tredinnick

Fixed a breakage with ManyToManyFields in admin caused by r10139.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@10170 bcc190cf-cafb-0310-a4f2-bffc1f526a37
üst 2c6c60ce
...@@ -644,6 +644,14 @@ class ManyToManyRel(object): ...@@ -644,6 +644,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):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment