Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#19605 closed Cleanup/optimization (fixed)

Unnecessary import in code examples from the docs

Reported by: sergzach Owned by: nobody
Component: Documentation Version: 1.5-beta-1
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

The next sample fragment has unnecessary imports of 'url' and 'include':

from django.conf.urls import patterns, url, include

urlpatterns = patterns('',
    (r'^articles/2003/$', 'news.views.special_case_2003'),
    (r'^articles/(\d{4})/$', 'news.views.year_archive'),
    (r'^articles/(\d{4})/(\d{2})/$', 'news.views.month_archive'),
    (r'^articles/(\d{4})/(\d{2})/(\d+)/$', 'news.views.article_detail'),
)

The link: https://docs.djangoproject.com/en/1.5/topics/http/urls/#example

Change History (5)

comment:1 by sergzach, 12 years ago

There are more such examples on the page.

comment:2 by Tim Graham, 12 years ago

Easy pickings: set
Triage Stage: UnreviewedAccepted
Type: UncategorizedCleanup/optimization

I'm guessing from django.conf.urls import import * was replaced generically.

comment:3 by Tim Graham <timograham@…>, 12 years ago

Resolution: fixed
Status: newclosed

In 43f89e0ad6fa111f3d53dfa71786353e0265bf39:

Fixed #19605 - Removed unused url imports from doc examples.

Thanks sergzach for the suggestion.

comment:4 by Tim Graham <timograham@…>, 12 years ago

In 360676d9d86ed36a2ffcf1318904b2b56cfae641:

[1.5.x] Fixed #19605 - Removed unused url imports from doc examples.

Thanks sergzach for the suggestion.

Backport of 43f89e0ad6 from master

comment:5 by Tim Graham <timograham@…>, 12 years ago

In 360676d9d86ed36a2ffcf1318904b2b56cfae641:

[1.5.x] Fixed #19605 - Removed unused url imports from doc examples.

Thanks sergzach for the suggestion.

Backport of 43f89e0ad6 from master

Note: See TracTickets for help on using tickets.
Back to Top