Explicitly name ids of clashing base models
This avoids the following error in django 1.11 tests:
polymorphic.MRODerived: (models.E005) The field 'id' from parent model 'polymorphic.mrobase3' clashes with the field 'id' from parent model 'polymorphic.mrobase1'.
Related to https://code.djangoproject.com/ticket/22442
fix_request_path_info
parent
a178ed751d
commit
8e52bdf6d1
|
|
@ -196,6 +196,7 @@ if django.VERSION >= (1, 7):
|
|||
|
||||
class MROBase1(ShowFieldType, PolymorphicModel):
|
||||
objects = MyManager()
|
||||
base_1_id = models.AutoField(primary_key=True)
|
||||
field1 = models.CharField(max_length=10) # needed as MyManager uses it
|
||||
|
||||
|
||||
|
|
@ -204,6 +205,7 @@ class MROBase2(MROBase1):
|
|||
|
||||
|
||||
class MROBase3(models.Model):
|
||||
base_3_id = models.AutoField(primary_key=True)
|
||||
objects = PolymorphicManager()
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue