Skip to content

Commit

Permalink
[1.0.X] Fixed a breakage with ManyToManyFields in admin caused by r10…
Browse files Browse the repository at this point in the history
…140. 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
  • Loading branch information
freakboy3742 committed Mar 25, 2009
1 parent dce8fdb commit 2e05920
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions django/db/models/fields/related.py
Expand Up @@ -637,6 +637,14 @@ def __init__(self, to, related_name=None, limit_choices_to=None,
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):
Expand Down

0 comments on commit 2e05920

Please sign in to comment.