Opened 20 months ago

Closed 20 months ago

Last modified 20 months ago

#21023 closed Cleanup/optimization (invalid)

Your documentation is poor at best.

Reported by: lam2015@… Owned by: nobody
Component: Documentation Version: 1.5
Severity: Normal Keywords: URL
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by ramiro)

Here is how you do it:

URLS:

from django.conf.urls import patterns, url

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

You go line by line and say r = raw. This means no escape characters, the compiler processes what it sees.
Next: ^ from Regular expressions means the beginning of the line beginning with the word articles?
The slash is:
Then you put parenthesis because?: GET IT?
then there is another slash

AND SO ON!!!! ONE STEP at a time

THIS IS HOW YOU EXPLAIN THINGS. Make believe the person reading it doesnt know anything about Regular expressions. These are not standard Regex.. not like Perl

Change History (5)

comment:1 Changed 20 months ago by anonymous

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

comment:2 Changed 20 months ago by lam2015@…

  • Type changed from Uncategorized to Cleanup/optimization

comment:3 Changed 20 months ago by mjtamlyn

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

The tutorial aims to strike a balance between newbie developers and new to django developers. It is explicitly not a *python* tutorial, and a detailed analysis of the structure of a python regex is not helpful in this context.

The current version of the docs has a number of links for understanding regexes better already. https://docs.djangoproject.com/en/1.5/intro/tutorial03/#url-argument-regex

comment:4 Changed 20 months ago by ramiro

  • Description modified (diff)

comment:5 Changed 20 months ago by aaugustin

Can we trade a lesson of "how to report a ticket without pissing off maintainers" against a lesson of "how to explain things in technical documentation"? ;-)

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