-
Notifications
You must be signed in to change notification settings - Fork 12
Hint 5 spoiler
Sébastiaan edited this page Mar 5, 2020
·
2 revisions
We're still editing the Profile
model. Go to your shoe_size
field and add the following options:
null=True
blank=True
Now if you clicked on the link to the documentation you should've seen that these were the first two in the list ;)
.......
class Profile(models.Model):
"""This class holds extra information about a member"""
.......
# ---- Personal information ------
programme = models.CharField(
max_length=20,
choices=PROGRAMME_CHOICES,
verbose_name=_('Study programme'),
blank=True,
null=True,
)
shoe_size = models.IntegerField(
verbose_name=_('Shoe size'),
validators=[MinValueValidator(39), MaxValueValidator(47)],
blank=True,
null=True,
)
.......
Now that the field is done we should generate and execute a new migration:
-
cd
into thewebsite/members
directory. - Use
../manage.py makemigrations
. - This creates a new migration in the
migrations
folder. - Update your local database by running
../manage.py migrate
.