summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2009-03-25 04:41:40 +0000
committerMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2009-03-25 04:41:40 +0000
commit6671b8b1cd388ccb16a734e9147f0c73638ebf48 (patch)
tree291b401c97116ed3c040f262a4fcacb53049f307
parent2c6c60cec613246bff5cb0be831969c20417b53c (diff)
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
-rw-r--r--django/db/models/fields/related.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/django/db/models/fields/related.py b/django/db/models/fields/related.py
index 1545c73f58..f986eea75b 100644
--- a/django/db/models/fields/related.py
+++ b/django/db/models/fields/related.py
@@ -644,6 +644,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):