Skip to content

Commit

Permalink
Fixed a breakage with ManyToManyFields in admin caused by r10139.
Browse files Browse the repository at this point in the history
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10170 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
malcolmt committed Mar 25, 2009
1 parent 2c6c60c commit 6671b8b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions django/db/models/fields/related.py
Original file line number Diff line number Diff line change
Expand Up @@ -644,6 +644,14 @@ def __init__(self, to, related_name=None, limit_choices_to=None,
self.multiple = True
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):
empty_strings_allowed = False
def __init__(self, to, to_field=None, rel_class=ManyToOneRel, **kwargs):
Expand Down

0 comments on commit 6671b8b

Please sign in to comment.