Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#22113 closed Cleanup/optimization (fixed)

Improving clarity of what object_name means in get_template_names() or SingleObjectTemplateResponseMixin

Reported by: nikunj.sg@… 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 Baptiste Mispelon, 11 years ago

Easy pickings: set
Triage Stage: UnreviewedAccepted

Hi,

I agree, model_name would 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_name in the documentation for MultipleObjectMixin [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

comment:2 by kobuz, 11 years ago

Keywords: nlsprint14 added
Owner: changed from nobody to kobuz
Status: newassigned

comment:4 by Baptiste Mispelon, 11 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 Baptiste Mispelon <bmispelon@…>, 11 years ago

Resolution: fixed
Status: assignedclosed

In b8874084868080baff29ac3453d20a845fd1568c:

Fixed #22113 -- changed object_name to model_name in CBV docs.

Thanks to trac user nikunj.sg for the report.

comment:6 by Baptiste Mispelon <bmispelon@…>, 11 years ago

In 79cc1fa58df17c3d9335a07086111bad8caa2d88:

[1.6.x] Fixed #22113 -- changed object_name to model_name in CBV docs.

Thanks to trac user nikunj.sg for the report.

Backport of b8874084868080baff29ac3453d20a845fd1568c from master.

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