Commit 658ab340 authored by eltronix's avatar eltronix Committed by Tim Graham
Browse files

[1.9.x] Fixed reference to Question model in management command how-to.

Backport of e2cb1018 from master
parent a06fa6e7
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -49,7 +49,7 @@ To implement the command, edit ``polls/management/commands/closepoll.py`` to
look like this::

    from django.core.management.base import BaseCommand, CommandError
    from polls.models import Poll
    from polls.models import Question as Poll

    class Command(BaseCommand):
        help = 'Closes the specified poll for voting'
@@ -98,8 +98,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``
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
the :doc:`tutorial</intro/tutorial01>` and was added to ``polls.models.Poll``
for this example.
the :doc:`tutorial</intro/tutorial01>` and was added to
``polls.models.Question`` for this example.

.. _custom-commands-options: