Ticket #7964: 7964.patch

File 7964.patch, 1001 bytes (added by Collin Grady, 16 years ago)
  • docs/tutorial02.txt

     
    9696But where's our poll app? It's not displayed on the admin index page.
    9797
    9898Just 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 and
    100 add the following to the bottom of the file::
     99objects have an admin interface. Create a ``mysite/polls/admin.py`` file and
     100add the following lines to it::
    101101
     102    from mysite.polls.models impot Poll
    102103    from django.contrib import admin
    103104   
    104105    admin.site.register(Poll)
     
    233234There are two ways to solve this problem. The first register ``Choice`` with the
    234235admin just as we did with ``Poll``. That's easy::
    235236
     237    from mysite.polls.models import Choice
     238
    236239    admin.site.register(Choice)
    237240
    238241Now "Choices" is an available option in the Django admin. The "Add choice" form
Back to Top