#14829 closed Bug (fixed)
URL dispatcher documentation with class-based generic views
| Reported by: | 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 )
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 , 15 years ago
| Description: | modified (diff) |
|---|
comment:2 by , 15 years ago
| Summary: | Documentation for url() with class-based generic views → URL dispatcher documentation with class-based generic views |
|---|---|
| Triage Stage: | Unreviewed → 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 by , 15 years ago
| milestone: | 1.3 |
|---|---|
| Severity: | → Normal |
| Type: | → Bug |
comment:6 by , 13 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
Fixed up the formatting.