diff options
| author | Russell Keith-Magee <russell@keith-magee.com> | 2009-03-25 11:00:20 +0000 |
|---|---|---|
| committer | Russell Keith-Magee <russell@keith-magee.com> | 2009-03-25 11:00:20 +0000 |
| commit | 2e059204018379a635a89a6ec3addc2d1e45cc49 (patch) | |
| tree | 405d30e15da58fa44d6d046de22b7b2e4d1695ad /django | |
| parent | dce8fdbc68941e0ee496a469d63673bbdf51fc77 (diff) | |
[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
Diffstat (limited to 'django')
| -rw-r--r-- | django/db/models/fields/related.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/django/db/models/fields/related.py b/django/db/models/fields/related.py index 8eab18b0c2..3e03f2cc71 100644 --- a/django/db/models/fields/related.py +++ b/django/db/models/fields/related.py @@ -637,6 +637,14 @@ class ManyToManyRel(object): 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): |
