Fixed #17024 -- Added import statements in tutorial code sample

This commit is contained in:
Claude Paroz 2012-06-30 20:50:24 +02:00
parent 2c2c8a6326
commit c446bdee84
1 changed files with 4 additions and 1 deletions

View File

@ -113,8 +113,8 @@ Just one thing to do: We need to tell the admin that ``Poll``
objects have an admin interface. To do this, create a file called objects have an admin interface. To do this, create a file called
``admin.py`` in your ``polls`` directory, and edit it to look like this:: ``admin.py`` in your ``polls`` directory, and edit it to look like this::
from polls.models import Poll
from django.contrib import admin from django.contrib import admin
from polls.models import Poll
admin.site.register(Poll) admin.site.register(Poll)
@ -283,6 +283,9 @@ It'd be better if you could add a bunch of Choices directly when you create the
Remove the ``register()`` call for the ``Choice`` model. Then, edit the ``Poll`` Remove the ``register()`` call for the ``Choice`` model. Then, edit the ``Poll``
registration code to read:: registration code to read::
from django.contrib import admin
from polls.models import Poll
class ChoiceInline(admin.StackedInline): class ChoiceInline(admin.StackedInline):
model = Choice model = Choice
extra = 3 extra = 3