Fixed reference to Question model in management command how-to.

This commit is contained in:
eltronix 2016-04-26 12:56:44 +03:00 committed by Tim Graham
parent a5033dbc58
commit e2cb1018cb
1 changed files with 3 additions and 3 deletions

View File

@ -49,7 +49,7 @@ To implement the command, edit ``polls/management/commands/closepoll.py`` to
look like this:: look like this::
from django.core.management.base import BaseCommand, CommandError from django.core.management.base import BaseCommand, CommandError
from polls.models import Poll from polls.models import Question as Poll
class Command(BaseCommand): class Command(BaseCommand):
help = 'Closes the specified poll for voting' help = 'Closes the specified poll for voting'
@ -88,8 +88,8 @@ The new custom command can be called using ``python manage.py closepoll
The ``handle()`` method takes one or more ``poll_ids`` and sets ``poll.opened`` The ``handle()`` method takes one or more ``poll_ids`` and sets ``poll.opened``
to ``False`` for each one. If the user referenced any nonexistent polls, a to ``False`` for each one. If the user referenced any nonexistent polls, a
:exc:`CommandError` is raised. The ``poll.opened`` attribute does not exist in :exc:`CommandError` is raised. The ``poll.opened`` attribute does not exist in
the :doc:`tutorial</intro/tutorial01>` and was added to ``polls.models.Poll`` the :doc:`tutorial</intro/tutorial01>` and was added to
for this example. ``polls.models.Question`` for this example.
.. _custom-commands-options: .. _custom-commands-options: