From 43f89e0ad6fa111f3d53dfa71786353e0265bf39 Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Tue, 15 Jan 2013 06:29:53 -0500 Subject: [PATCH] Fixed #19605 - Removed unused url imports from doc examples. Thanks sergzach for the suggestion. --- docs/intro/overview.txt | 2 +- docs/ref/contrib/admin/index.txt | 6 +++--- docs/ref/contrib/comments/example.txt | 2 +- docs/ref/contrib/sitemaps.txt | 2 +- docs/ref/contrib/syndication.txt | 4 ++-- docs/ref/models/instances.txt | 2 +- docs/topics/class-based-views/generic-display.txt | 2 +- docs/topics/class-based-views/index.txt | 4 ++-- docs/topics/http/urls.txt | 10 +++++----- 9 files changed, 17 insertions(+), 17 deletions(-) diff --git a/docs/intro/overview.txt b/docs/intro/overview.txt index ba49e3ccf2..7cca8bf51b 100644 --- a/docs/intro/overview.txt +++ b/docs/intro/overview.txt @@ -176,7 +176,7 @@ decouple URLs from Python code. Here's what a URLconf might look like for the ``Reporter``/``Article`` example above:: - from django.conf.urls import patterns, url, include + from django.conf.urls import patterns urlpatterns = patterns('', (r'^articles/(\d{4})/$', 'news.views.year_archive'), diff --git a/docs/ref/contrib/admin/index.txt b/docs/ref/contrib/admin/index.txt index 065c9566ea..1dbde2a98c 100644 --- a/docs/ref/contrib/admin/index.txt +++ b/docs/ref/contrib/admin/index.txt @@ -1928,7 +1928,7 @@ In this example, we register the default ``AdminSite`` instance ``django.contrib.admin.site`` at the URL ``/admin/`` :: # urls.py - from django.conf.urls import patterns, url, include + from django.conf.urls import patterns, include from django.contrib import admin admin.autodiscover() @@ -1944,7 +1944,7 @@ In this example, we register the ``AdminSite`` instance ``myproject.admin.admin_site`` at the URL ``/myadmin/`` :: # urls.py - from django.conf.urls import patterns, url, include + from django.conf.urls import patterns, include from myproject.admin import admin_site urlpatterns = patterns('', @@ -1968,7 +1968,7 @@ separate versions of the admin site -- using the ``AdminSite`` instances respectively:: # urls.py - from django.conf.urls import patterns, url, include + from django.conf.urls import patterns, include from myproject.admin import basic_site, advanced_site urlpatterns = patterns('', diff --git a/docs/ref/contrib/comments/example.txt b/docs/ref/contrib/comments/example.txt index 4e18e37de0..e99c10f732 100644 --- a/docs/ref/contrib/comments/example.txt +++ b/docs/ref/contrib/comments/example.txt @@ -141,7 +141,7 @@ enable it in your project's ``urls.py``: .. code-block:: python - from django.conf.urls import patterns, url, include + from django.conf.urls import patterns from django.contrib.comments.feeds import LatestCommentFeed urlpatterns = patterns('', diff --git a/docs/ref/contrib/sitemaps.txt b/docs/ref/contrib/sitemaps.txt index 1861318b95..ded7a84fbc 100644 --- a/docs/ref/contrib/sitemaps.txt +++ b/docs/ref/contrib/sitemaps.txt @@ -256,7 +256,7 @@ Example Here's an example of a :doc:`URLconf ` using both:: - from django.conf.urls import patterns, url, include + from django.conf.urls import patterns from django.contrib.sitemaps import FlatPageSitemap, GenericSitemap from blog.models import Entry diff --git a/docs/ref/contrib/syndication.txt b/docs/ref/contrib/syndication.txt index d0376e3c1b..2955d7dad3 100644 --- a/docs/ref/contrib/syndication.txt +++ b/docs/ref/contrib/syndication.txt @@ -77,7 +77,7 @@ latest five news items:: To connect a URL to this feed, put an instance of the Feed object in your :doc:`URLconf `. For example:: - from django.conf.urls import patterns, url, include + from django.conf.urls import patterns from myproject.feeds import LatestEntriesFeed urlpatterns = patterns('', @@ -321,7 +321,7 @@ Here's a full example:: And the accompanying URLconf:: - from django.conf.urls import patterns, url, include + from django.conf.urls import patterns from myproject.feeds import RssSiteNewsFeed, AtomSiteNewsFeed urlpatterns = patterns('', diff --git a/docs/ref/models/instances.txt b/docs/ref/models/instances.txt index 4479e4b766..92071b8d3f 100644 --- a/docs/ref/models/instances.txt +++ b/docs/ref/models/instances.txt @@ -601,7 +601,7 @@ pattern, it's possible to give a name to a pattern, and then reference the name rather than the view function. A named URL pattern is defined by replacing the pattern tuple by a call to the ``url`` function):: - from django.conf.urls import patterns, url, include + from django.conf.urls import url url(r'^people/(\d+)/$', 'blog_views.generic_detail', name='people_view'), diff --git a/docs/topics/class-based-views/generic-display.txt b/docs/topics/class-based-views/generic-display.txt index dac45c8843..835ca07459 100644 --- a/docs/topics/class-based-views/generic-display.txt +++ b/docs/topics/class-based-views/generic-display.txt @@ -110,7 +110,7 @@ Now we need to define a view:: Finally hook that view into your urls:: # urls.py - from django.conf.urls import patterns, url, include + from django.conf.urls import patterns, url from books.views import PublisherList urlpatterns = patterns('', diff --git a/docs/topics/class-based-views/index.txt b/docs/topics/class-based-views/index.txt index 54d4b0f252..302f473eea 100644 --- a/docs/topics/class-based-views/index.txt +++ b/docs/topics/class-based-views/index.txt @@ -37,7 +37,7 @@ URLconf. If you're only changing a few simple attributes on a class-based view, you can simply pass them into the :meth:`~django.views.generic.base.View.as_view` method call itself:: - from django.conf.urls import patterns, url, include + from django.conf.urls import patterns from django.views.generic import TemplateView urlpatterns = patterns('', @@ -73,7 +73,7 @@ point the URL to the :meth:`~django.views.generic.base.View.as_view` class method instead, which provides a function-like entry to class-based views:: # urls.py - from django.conf.urls import patterns, url, include + from django.conf.urls import patterns from some_app.views import AboutView urlpatterns = patterns('', diff --git a/docs/topics/http/urls.txt b/docs/topics/http/urls.txt index 8a07d46f77..c5eef8bb41 100644 --- a/docs/topics/http/urls.txt +++ b/docs/topics/http/urls.txt @@ -66,7 +66,7 @@ Example Here's a sample URLconf:: - from django.conf.urls import patterns, url, include + from django.conf.urls import patterns urlpatterns = patterns('', (r'^articles/2003/$', 'news.views.special_case_2003'), @@ -255,7 +255,7 @@ code duplication. Here's the example URLconf from the :doc:`Django overview `:: - from django.conf.urls import patterns, url, include + from django.conf.urls import patterns urlpatterns = patterns('', (r'^articles/(\d{4})/$', 'news.views.year_archive'), @@ -270,7 +270,7 @@ each view function. With this in mind, the above example can be written more concisely as:: - from django.conf.urls import patterns, url, include + from django.conf.urls import patterns urlpatterns = patterns('news.views', (r'^articles/(\d{4})/$', 'year_archive'), @@ -291,7 +291,7 @@ Just add multiple ``patterns()`` objects together, like this: Old:: - from django.conf.urls import patterns, url, include + from django.conf.urls import patterns urlpatterns = patterns('', (r'^$', 'myapp.views.app_index'), @@ -301,7 +301,7 @@ Old:: New:: - from django.conf.urls import patterns, url, include + from django.conf.urls import patterns urlpatterns = patterns('myapp.views', (r'^$', 'app_index'),