#26007: SingleObjectTemplateResponseMixin.get_template_names does not return 
names
stack properly.
-------------------------------+--------------------
     Reporter:  chmarr         |      Owner:  nobody
         Type:  Bug            |     Status:  new
    Component:  Generic views  |    Version:  1.9
     Severity:  Normal         |   Keywords:
 Triage Stage:  Unreviewed     |  Has patch:  0
Easy pickings:  0              |      UI/UX:  0
-------------------------------+--------------------
 The docstring for SingleObjectTemplateResponseMixin.get_template_names()
 implies that a particular list of names is being returned. However, if
 SingleObjectTemplateResponseMixin.get_template_names() (the super) returns
 anything, then only the template_name will be returned.

 In addition, the name obtained by using self.template_name_field is
 inserted at 0, implying that there is something to insert it in front of,
 which is impossible given the current implementation, and conflicts with
 the documentation.

 By inference, it appears that the intended implementation is that the
 following names are returned, in this order:
 * a template derived from the template_name_field field of the object.
 * a template derived from the super (the template_name) attribute of the
 view
 * a template derived from the object's model name or self.model's name,
 with the template_name_suffix appended.

 Change will need some refactoring of the method, change to the docstring,
 and the documentation. I'll provide a pull request.

--
Ticket URL: <https://code.djangoproject.com/ticket/26007>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/049.cd41fd856fe6a6398762142bb0385588%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to