Hello
I am new to django, and i am following the tutorial provide in github, from the tutorial.
and start from 227, it shows the following instructions:
|
|
|
| .. console:: |
|
|
| $ python manage.py makemigrations polls |
|
|
| You should see something similar to the following: |
|
|
| .. code-block:: text |
|
|
| Migrations for 'polls': |
| polls/migrations/0001_initial.py: |
| - Create model Choice |
| - Create model Question |
| - Add field question to choice
|
However, after following the steps
I'm missing the last sentence (Add field question to choice) .
The below is what i had written in model.py, did i make something wrong?
Thanks
from django.db import models
class Question(models.Model):
question_text = models.CharField(max_length=200)
pub_date = models.DateTimeField('date published')
class Choice(models.Model):
question = models.ForeignKey(Question, on_delete=models.CASCADE)
choice_text = models.CharField(max_length=200)
votes = models.IntegerField(default=0)Thanks