summaryrefslogtreecommitdiff
path: root/django/oldforms
diff options
context:
space:
mode:
authorJeremy Dunck <jdunck@gmail.com>2007-03-23 16:35:57 +0000
committerJeremy Dunck <jdunck@gmail.com>2007-03-23 16:35:57 +0000
commitfa3ed6e1341f7c8b468e2267b3fafddeb58cdac2 (patch)
tree6d8bf65854f8431355e2d91cbc61a37ab6f23d9a /django/oldforms
parent8b279b63bef5c1348cc27c50633fc2d5ef09d7c1 (diff)
gis: Merged revisions 4669-4785 via svnmerge from trunk.
git-svn-id: http://code.djangoproject.com/svn/django/branches/gis@4786 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/oldforms')
-rw-r--r--django/oldforms/__init__.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/django/oldforms/__init__.py b/django/oldforms/__init__.py
index decf0f7064..56101984f5 100644
--- a/django/oldforms/__init__.py
+++ b/django/oldforms/__init__.py
@@ -130,7 +130,9 @@ class FormWrapper(object):
if self.edit_inline:
self.fill_inline_collections()
for inline_collection in self._inline_collections:
- if inline_collection.name == key:
+ # The 'orig_name' comparison is for backwards compatibility
+ # with hand-crafted forms.
+ if inline_collection.name == key or (':' not in key and inline_collection.orig_name == key):
return inline_collection
raise KeyError, "Could not find Formfield or InlineObjectCollection named %r" % key
@@ -226,6 +228,9 @@ class InlineObjectCollection(object):
self.errors = errors
self._collections = None
self.name = rel_obj.name
+ # This is the name used prior to fixing #1839. Needs for backwards
+ # compatibility.
+ self.orig_name = rel_obj.opts.module_name
def __len__(self):
self.fill()