Using model inheritance and defining a non-null error error

I used the inheritance model in my project after changing the model; but I give an error with a zero field. What should I do? I am using Django 1.7

class Questions(models.Model):
    question_category = models.ForeignKey(Course, blank=False)
    question_author = models.ForeignKey(Author, blank=False)
    question_details = models.CharField(max_length=100, blank=False, default='')
    timestamp = models.DateTimeField(auto_now_add=True)

class TypeFive(Questions):
    question_title = models.CharField(max_length=100, blank=False, default=generator(5), unique=True, editable=False)

    def __str__(self):
        return "{}".format(self.question_title)


class TypeFiveChoice(models.Model):
    question_choice = models.ForeignKey(TypeFive)
    is_it_question = models.BooleanField(default=False)
    word = models.CharField(default='', blank=False, max_length=20)
    translate = models.CharField(default='', blank=False, max_length=20)
    timestamp = models.DateTimeField(auto_now_add=True)

    def __str__(self):
        return "{} : {}, {}".format(self.question_choice, self.word, self.translate)

After migration:

You are trying to add a non-nullable field 'questions_ptr' to typefive without a default; we can't do that (the database needs something to populate existing rows).
Please select a fix:
 1) Provide a one-off default now (will be set on all existing rows)
 2) Quit, and let me add a default in models.py
+4
source share
1 answer

To inherit from Questionsin TypeFive, Django needs to add a relation from TypeFiveto Questions. For all entries in TypeFivethat may already be in the database.

Django , TopFive to. , migrate. , , .

, . , ?

, migrate 1, enter. primary key Questions, , enter.

Django TypeFive, , (, TypeFive Django).

+4

All Articles