I'm trying create a model inherit following this tutorial:
[2
CodePudding user response:
According to the Django Documentation for Models, you need to define your database fields as Class attributes.
I.o.w:
class Fish (models.Model):
first_name = models.CharField(max_length=64)
last_name = models.CharField(max_length=64)
def __init__(self, first_name, last_name="Fish"):
self.first_name = first_name
self.last_name = last_name
Doing so will allow them to be created in the database when you run the migration.