Code

Opened 3 years ago

Closed 19 months ago

Last modified 19 months 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)

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'),
)

Attachments (0)

Change History (7)

comment:1 Changed 3 years ago by Alex

  • Description modified (diff)
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

Fixed up the formatting.

comment:2 Changed 3 years ago by DrMeers

  • Summary changed from Documentation for url() with class-based generic views to URL dispatcher documentation with class-based generic views
  • Triage Stage changed from Unreviewed to Accepted

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 Changed 3 years ago by anonymous

  • milestone 1.3 deleted
  • Severity set to Normal
  • Type set to Bug

comment:4 Changed 2 years ago by aaugustin

  • UI/UX unset

Change UI/UX from NULL to False.

comment:5 Changed 2 years ago by aaugustin

  • Easy pickings unset

Change Easy pickings from NULL to False.

comment:6 Changed 19 months ago by Tim Graham <timograham@…>

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

In acd74ffa358a64861fae8fd7bf020fc3a50341b2:

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

comment:7 Changed 19 months ago by Tim Graham <timograham@…>

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

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.