Ticket #17673: multi_inheritance_field_clash.patch

File multi_inheritance_field_clash.patch, 612 bytes (added by aron45, 10 years ago)

disallow multi inheritance (eg. grandfather) field clash

  • django/db/models/base.py

    diff --git a/django/db/models/base.py b/django/db/models/base.py
    index 9d79a11..a20856b 100644
    a b class Model(six.with_metaclass(ModelBase)):  
    13041304        used_fields = {}  # name or attname -> field
    13051305
    13061306        # Check that multi-inheritance doesn't cause field name shadowing.
    1307         for parent in cls._meta.parents:
     1307        for parent in cls._meta.get_parent_list():
    13081308            for f in parent._meta.local_fields:
    13091309                clash = used_fields.get(f.name) or used_fields.get(f.attname) or None
    13101310                if clash:
Back to Top