From 8a0fa758398768f28d73856275651719d00fe991 Mon Sep 17 00:00:00 2001 From: James Bennett Date: Wed, 7 Mar 2007 17:03:43 +0000 Subject: [PATCH] 0.91-bugfixes: Fixed #999 by resolving name clash in the metasystem which could confuse manipulators about which fields they should follow. Refs #1808, #1826, #1839 and #2415, which are variations of this that persist in trunk. git-svn-id: http://code.djangoproject.com/svn/django/branches/0.91-bugfixes@4673 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/core/meta/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/django/core/meta/__init__.py b/django/core/meta/__init__.py index 8121736096..5507bd0272 100644 --- a/django/core/meta/__init__.py +++ b/django/core/meta/__init__.py @@ -151,7 +151,7 @@ class BadKeywordArguments(Exception): class BoundRelatedObject(object): def __init__(self, related_object, field_mapping, original): self.relation = related_object - self.field_mappings = field_mapping[related_object.opts.module_name] + self.field_mappings = field_mapping[related_object.name] def template_name(self): raise NotImplementedError @@ -165,7 +165,7 @@ class RelatedObject(object): self.opts = opts self.field = field self.edit_inline = field.rel.edit_inline - self.name = opts.module_name + self.name = '%s_%s' % (opts.app_label, opts.module_name) self.var_name = opts.object_name.lower() def flatten_data(self, follow, obj=None):