1
0
mirror of https://github.com/django/django.git synced 2025-10-23 21:59:11 +00:00

Alphabetized imports in various docs.

Follow-up of d97cce3409 and 7d3fe36c62.
This commit is contained in:
Mariusz Felisiak
2018-05-12 19:37:42 +02:00
committed by GitHub
parent 1b7d524cfa
commit 35319bf12c
36 changed files with 71 additions and 71 deletions

View File

@@ -69,7 +69,7 @@ necessary:
.. code-block:: python
# Import the models we created from our "news" app
>>> from news.models import Reporter, Article
>>> from news.models import Article, Reporter
# No reporters are in the system yet.
>>> Reporter.objects.all()

View File

@@ -383,7 +383,7 @@ the Python import path to your :file:`mysite/settings.py` file.
Once you're in the shell, explore the :doc:`database API </topics/db/queries>`::
>>> from polls.models import Question, Choice # Import the model classes we just wrote.
>>> from polls.models import Choice, Question # Import the model classes we just wrote.
# No questions are in the system yet.
>>> Question.objects.all()
@@ -469,7 +469,7 @@ the :doc:`time zone support docs </topics/i18n/timezones>`.
Save these changes and start a new Python interactive shell by running
``python manage.py shell`` again::
>>> from polls.models import Question, Choice
>>> from polls.models import Choice, Question
# Make sure our __str__() addition worked.
>>> Question.objects.all()

View File

@@ -69,8 +69,8 @@ create a real version. Add the following to ``polls/views.py``:
.. snippet::
:filename: polls/views.py
from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import get_object_or_404, render
from django.http import HttpResponseRedirect, HttpResponse
from django.urls import reverse
from .models import Choice, Question
@@ -262,8 +262,8 @@ views and use Django's generic views instead. To do so, open the
.. snippet::
:filename: polls/views.py
from django.shortcuts import get_object_or_404, render
from django.http import HttpResponseRedirect
from django.shortcuts import get_object_or_404, render
from django.urls import reverse
from django.views import generic

View File

@@ -171,8 +171,8 @@ Put the following in the ``tests.py`` file in the ``polls`` application:
import datetime
from django.utils import timezone
from django.test import TestCase
from django.utils import timezone
from .models import Question