Opened 16 years ago
Closed 16 years ago
#8082 closed (invalid)
Example Code error in Django Docs for Generic Views
Reported by: | lucasx | Owned by: | nobody |
---|---|---|---|
Component: | Uncategorized | Version: | dev |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
There is an error in this piece of documentation:
http://www.djangoproject.com/documentation/generic_views/#django-views-generic-simple-direct-to-template
The example shows the 'direct_to_template' function surrounded by 'single quotes'. However, in the book, it shows the function being called without quotes:
http://www.djangobook.com/en/1.0/chapter09/#cn12
Surrounding the direct_to_template function with quotes yields this error:
TypeError at /
'str' object is not callable
When used without quotes it works fine. Simple correction to 'djangoproject' documentation is required.
If you're getting an error, you're doing something wrong. It's not an error to specify a view name as a string.