Ticket #13987: 13987_primary_key_fix_1.diff

File 13987_primary_key_fix_1.diff, 647 bytes (added by Aramgutang, 5 years ago)

1st possible fix: adding a primary_key=True to the OneToOneField initialisation.

  • django/db/models/base.py

     
    151151                elif not is_proxy:
    152152                    attr_name = '%s_ptr' % base._meta.module_name
    153153                    field = OneToOneField(base, name=attr_name,
    154                             auto_created=True, parent_link=True)
     154                            auto_created=True, parent_link=True, primary_key=True)
    155155                    new_class.add_to_class(attr_name, field)
    156156                else:
    157157                    field = None
Back to Top