Anonymous user
Adding a field to the profile: Difference between revisions
no edit summary
imported>Mark No edit summary |
imported>Mark No edit summary |
||
Line 156:
Open models.py and search for "homepage_url". The results of this search should leave you just inside of the Person class. If you look at the surrounding code, you should also notice other familiar fields (take a look back at the template changes you just made), such as irc_nick. Now you should feel confident that this is exactly where you need to add a new field for birthday.
At the end of the field definitions, just following the line that adds irc_nick, add a new field for birthday. According to the [https://docs.djangoproject.com/en/dev/ref/models/fields/#datefield Django documentation], you want to use a DateField for storing dates. You will also want to tell the model that it is OK for someone to leave the field blank. You can do that by appending (blank=
<div class="example"><pre>
birthday = models.DateField(blank=
</pre></div>
|