0

My Models Are:

from django.db import models

Create your models here.

class ExamCenter(models.Model):

cname=models.CharField(max_length=70)
city=models.CharField(max_length=60)

class Student(ExamCenter):

 name=models.CharField(max_length=60,default=False)
 roll=models.IntegerField(default=False)
  1. when i Type python manage.py it generate an error but i cannot find it. the error is You are trying to add a non-nullable field 'examcenter_ptr' to student without a default; we can't do that (the database needs something to populate existing rows). 2.remember It is a Multitable inheritance.
zia ullah
  • 1
  • 1
  • Does this answer your question? [You are trying to add a non-nullable field 'new\_field' to userprofile without a default](https://stackoverflow.com/questions/26185687/you-are-trying-to-add-a-non-nullable-field-new-field-to-userprofile-without-a) – Abdul Aziz Barkat Feb 05 '21 at 17:10
  • Hello , you can also define your filed like this; examcenter_ptr = models.CharField( max_length = 60, null = False, blank = True ) – Can İlgu Feb 05 '21 at 17:14
  • I am interested in this line: ```name=models.CharField(max_length=60,default=False)``` How come ```default``` becomes False Here? Shouldn't it be filled up with any value or ```None``` instead? – Mohammad Monir Hossain Feb 08 '21 at 10:14

0 Answers0