Ticket #7964: 7964.patch
File 7964.patch, 1001 bytes (added by , 16 years ago) |
---|
-
docs/tutorial02.txt
96 96 But where's our poll app? It's not displayed on the admin index page. 97 97 98 98 Just one thing to do: We need to tell the admin that ``Poll`` 99 objects have an admin interface. Edit the ``mysite/polls/models.py`` file and100 add the following to the bottom of the file::99 objects have an admin interface. Create a ``mysite/polls/admin.py`` file and 100 add the following lines to it:: 101 101 102 from mysite.polls.models impot Poll 102 103 from django.contrib import admin 103 104 104 105 admin.site.register(Poll) … … 233 234 There are two ways to solve this problem. The first register ``Choice`` with the 234 235 admin just as we did with ``Poll``. That's easy:: 235 236 237 from mysite.polls.models import Choice 238 236 239 admin.site.register(Choice) 237 240 238 241 Now "Choices" is an available option in the Django admin. The "Add choice" form