Opened 11 years ago
Closed 11 years ago
#21336 closed Uncategorized (worksforme)
ListView doesnt work with context_object_name
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | Documentation | Version: | 1.5 |
Severity: | Normal | 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
I read in the documentation that the template_object_name has been replaced with context_object_name. But when I try to get the ListView of a model, it doesnt work with context_object_name but works with template_object_name. I also tried the DetailView. In DetailView, it seems that replacement has been done because I got an error when I tried to use template_object_name but DetailView worked as expected with context_object_name.
Note:
See TracTickets
for help on using tickets.
template_object_name was definitely replaced with context_object_name when changing from function to class-based generic views.
If you grep the source code for 1.5, you can see that template_object_name does not appear any where in the code:
Note the warning in the docs that the template_object_name was appended with the suffix '_list', but in a class-based ListView, the context_object_name is used verbatim.
If you need further help please see https://code.djangoproject.com/wiki/TicketClosingReasons/UseSupportChannels