Ticket #12143: m2m_fix.diff

File m2m_fix.diff, 620 bytes (added by Alex, 6 years ago)

Can you confirm whether this fixes the issue for you?

  • django/db/models/fields/related.py

    diff --git a/django/db/models/fields/related.py b/django/db/models/fields/related.py
    index 2f1193f..e8a4b98 100644
    a b def create_many_to_many_intermediary_model(field, klass): 
    819819    name = '%s_%s' % (klass._meta.object_name, field.name)
    820820    if field.rel.to == RECURSIVE_RELATIONSHIP_CONSTANT or field.rel.to == klass._meta.object_name:
    821821        from_ = 'from_%s' % to.lower()
    822         to = to.lower()
     822        to = 'to_%s' % to.lower()
    823823    else:
    824824        from_ = klass._meta.object_name.lower()
    825825        to = to.lower()
Back to Top