Code

Opened 15 months ago

Closed 15 months ago

Last modified 14 months 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

Attachments (0)

Change History (5)

comment:1 Changed 15 months ago by sergzach

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

There are more such examples on the page.

comment:2 Changed 15 months ago by timo

  • Easy pickings set
  • Triage Stage changed from Unreviewed to Accepted
  • Type changed from Uncategorized to Cleanup/optimization

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

comment:3 Changed 15 months ago by Tim Graham <timograham@…>

  • Resolution set to fixed
  • Status changed from new to closed

In 43f89e0ad6fa111f3d53dfa71786353e0265bf39:

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

Thanks sergzach for the suggestion.

comment:4 Changed 15 months ago by Tim Graham <timograham@…>

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 Changed 14 months ago by Tim Graham <timograham@…>

In 360676d9d86ed36a2ffcf1318904b2b56cfae641:

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

Thanks sergzach for the suggestion.

Backport of 43f89e0ad6 from master

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.