Opened 14 years ago

Closed 12 years ago

Last modified 12 years ago

#14829 closed Bug (fixed)

URL dispatcher documentation with class-based generic views

Reported by: Andrew Willey <andrew@…> Owned by: nobody
Component: Documentation Version: 1.3-alpha
Severity: Normal Keywords: url
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Alex Gaynor)

It would be nice to update the url() documentation here

http://docs.djangoproject.com/en/dev/topics/http/urls/#url

to reflect that using class-based generic views means you pass the class object instead of view='some_view' and that class-based views must be imported as opposed to included in the patterns arguments.

example:

from myapp.views import *

urlpatterns += patterns('', 
    url(GenericViewClass.as_view(), name='the_url_name'),
)

Change History (7)

comment:1 by Alex Gaynor, 14 years ago

Description: modified (diff)

Fixed up the formatting.

comment:2 by Simon Meers, 14 years ago

Summary: Documentation for url() with class-based generic viewsURL dispatcher documentation with class-based generic views
Triage Stage: UnreviewedAccepted

We could change the URL Dispatcher documentation in *many* places to specify the class-based view alternatives. What might be better is to update "Once one of the regexes matches, Django imports and calls the given view, which is a simple Python function." (1) to better define views based on the recent updates, and refer the reader to the class-based view documentation (2) for more information. There may be some other simple changes required elsewhere in the document also.

(1) http://docs.djangoproject.com/en/dev/topics/http/urls/#how-django-processes-a-request

(2) http://docs.djangoproject.com/en/dev/topics/class-based-views/

comment:3 by anonymous, 14 years ago

milestone: 1.3
Severity: Normal
Type: Bug

comment:4 by Aymeric Augustin, 13 years ago

UI/UX: unset

Change UI/UX from NULL to False.

comment:5 by Aymeric Augustin, 13 years ago

Easy pickings: unset

Change Easy pickings from NULL to False.

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

Resolution: fixed
Status: newclosed

In acd74ffa358a64861fae8fd7bf020fc3a50341b2:

Fixed #14829 - Added references to CBVs in the URLConf docs; thanks Andrew Willey for the suggestion.

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

In 57cdbf3bf8e80eb5c265852bfa5eb4b3f514809e:

[1.4.X] Fixed #14829 - Added references to CBVs in the URLConf docs; thanks Andrew Willey for the suggestion.

Backport of acd74ffa35 from master

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