Opened 14 years ago

Closed 14 years ago

#15614 closed (fixed)

Documentation typo

Reported by: anonymous Owned by: nobody
Component: Uncategorized Version: 1.2
Severity: Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

On this page: http://docs.djangoproject.com/en/1.2/ref/generic-views/

When I try the example for the direct_to_template:

(r'^foo/$',             'direct_to_template', {'template': 'foo_index.html'}),

I got a str object is not callable error.

If I remove the quotes around direct_to_template it does work.

(r'^foo/$',             direct_to_template, {'template': 'foo_index.html'}),

Change History (2)

comment:1 by Adrian Holovaty, 14 years ago

Triage Stage: UnreviewedAccepted

Good catch. Looks like we have the same problem with redirect_to in that same document. I'm working on a fix...

comment:2 by Adrian Holovaty, 14 years ago

Resolution: fixed
Status: newclosed

In [15822]:

Fixed #15614 -- Fixed potentially confusing URLconf examples in docs/ref/generic-views.txt by adding explicit import statement and using function passing instead of strings in the URLpattern

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