How to override a field in the parent class

Viewed 5130

I have parent and child classes in Django model. And I want to fill a field in parent class when initialize child class. Or override this field in child class.

    class Parent(models.Model):
        type = models.CharField()

    class Child(Parent):
        type = models.CharField()  //Doesn't work

Also trying override init method, but it doesn't work too. How can I accomplish this?

1 Answers
Related