#22113 closed Cleanup/optimization (fixed)
Improving clarity of what object_name means in get_template_names() or SingleObjectTemplateResponseMixin
| Reported by: | Owned by: | kobuz | |
|---|---|---|---|
| Component: | Documentation | Version: | 1.6 |
| Severity: | Normal | Keywords: | nlsprint14 |
| Cc: | Triage Stage: | Accepted | |
| Has patch: | no | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | yes |
| Easy pickings: | yes | UI/UX: | no |
Description
In the third bullet of https://docs.djangoproject.com/en/dev/ref/class-based-views/mixins-single-object/#django.views.generic.detail.SingleObjectTemplateResponseMixin.get_template_names, it would be clearer if you changed object_name to object_model name or model_name since objects do not have names
Change History (6)
comment:1 by , 12 years ago
| Easy pickings: | set |
|---|---|
| Triage Stage: | Unreviewed → Accepted |
comment:2 by , 12 years ago
| Keywords: | nlsprint14 added |
|---|---|
| Owner: | changed from to |
| Status: | new → assigned |
comment:4 by , 12 years ago
| Patch needs improvement: | set |
|---|
There's still some mentions of model_name in the docs.
The following command will show you where:
git grep -E "[^_]object_name" docs/
comment:5 by , 12 years ago
| Resolution: | → fixed |
|---|---|
| Status: | assigned → closed |
Note:
See TracTickets
for help on using tickets.
Hi,
I agree,
model_namewould probably be a better name (this is the actual name of the attribute that the code uses).For completeness' sake, you should probably also alter the docstring of
django.views.generic.base.SingleObjectTemplateResponseMixin.get_template_names.There's also a mention of
object_namein the documentation forMultipleObjectMixin[1] which should be changed.Thanks.
[1] https://docs.djangoproject.com/en/dev/ref/class-based-views/mixins-multiple-object/#django.views.generic.list.MultipleObjectMixin.get_context_object_name