models.py '''
class Person(models.Model):
firstname = models.CharField(max_length=30)
lastname = models.CharField(max_length=30)
othernames = models.CharField(max_length=40)
dateOfBirth = models.DateField()
gender = models.CharField(max_length=20)
birthGender = models.CharField(max_length=20)
email = models.EmailField(max_length=100)
class Student(Person):
studentId = models.IntegerField()
admissionDate = models.DateField()
enrolmentStatus = models.BooleanField()
studentExamCode = models.IntegerField()
schoolYear = models.IntegerField()
'''
forms.py'''
class studentF(ModelForm):
class Meta:
model = Student
fields = ['firstname', 'lastname', 'othernames', 'dateOfBirth', 'gender', 'birthGender', 'email', 'studentId', 'admissionDate', 'enrolmentStatus', 'studentExamCode', 'schoolYear']
'''
我收到标题中的错误,如何解决?
确保你已经做了@raphael 说你应该做的事情。如果问题仍然存在,
python manage.py makemigrations --merge
python manage.py migrate --fake