I get this exception:
django.core.exceptions.FieldError:
Local field 'ticket' in class 'SpecialPlugin' clashes with field of similar name from base class 'BasePlugin'
Here are my models:
class BasePlugin(models.Model):
ticket = models.OneToOneField('foobar.ticket', primary_key=True,
related_name='%(app_label)s_%(class)s')
class Meta(IndexImplementation.Meta):
abstract = True
# .. Other stuff which should be available for SpecialPlugin
# and other child classes.
class SpecialPlugin(BasePlugin):
ticket = models.OneToOneField('foobar.ticket', primary_key=True,
related_name='special')
I only found this note, but in my case the parent class is abstract. I am unsure if it applies here.
I want to give the child class SpecialPlugin
the related name "special" since the related name (%(app_label)s_%(class)s
) of the BasePlugin would break old code.
Is there a way to give SpecialPlugin.ticket the related_name "special"?
BasePlugin
isn't correctly being set as abstract. What is inIndexImplementation.Meta
?