Fixed #12143 -- Corrected the naming of the 'to' column in recursive m2m models. Thanks to knutin@gmail.com for the report, and Alex Gaynor for the patch.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@11713 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Russell Keith-Magee 2009-11-03 23:34:58 +00:00
parent dab3e97c1a
commit f9ead3fe42
1 changed files with 1 additions and 1 deletions

View File

@ -819,7 +819,7 @@ def create_many_to_many_intermediary_model(field, klass):
name = '%s_%s' % (klass._meta.object_name, field.name) name = '%s_%s' % (klass._meta.object_name, field.name)
if field.rel.to == RECURSIVE_RELATIONSHIP_CONSTANT or field.rel.to == klass._meta.object_name: if field.rel.to == RECURSIVE_RELATIONSHIP_CONSTANT or field.rel.to == klass._meta.object_name:
from_ = 'from_%s' % to.lower() from_ = 'from_%s' % to.lower()
to = to.lower() to = 'to_%s' % to.lower()
else: else:
from_ = klass._meta.object_name.lower() from_ = klass._meta.object_name.lower()
to = to.lower() to = to.lower()