From 8e52bdf6d146a3df533177bd47eaf05076466644 Mon Sep 17 00:00:00 2001 From: Charlie Denton Date: Thu, 2 Mar 2017 23:33:01 +0000 Subject: [PATCH] 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 --- polymorphic/tests/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/polymorphic/tests/__init__.py b/polymorphic/tests/__init__.py index 892e570..f8fd2e8 100644 --- a/polymorphic/tests/__init__.py +++ b/polymorphic/tests/__init__.py @@ -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()