I want to over-write a field in a child model.
My base model
class AbstractProduct(models.Model):
...
structure = models.CharField(
_("Product structure"), max_length=10, choices=STRUCTURE_CHOICES,
default=STANDALONE)
Now I subclass this model in other model
class Product(AbstractProduct):
....
structure = models.CharField(
_("Product structure"), max_length=10, choices=STRUCTURE_CHOICES2,
default=STANDALONE)
Error I get:
django.core.exceptions.FieldError: Local field 'structure'
in class 'Product' clashes with field of similar name
from base class 'AbstractProduct'
This answer says it's NOT possible. But seems like an old post. Also tried put in it def __init__
as one of the answers mentioned, but still no avail. Is there any workaround this or still not possible ?