Opened 7 years ago

Closed 7 years ago

Last modified 4 years ago

#8420 closed (wontfix)

Inconsistent use of template_name in generic views

Reported by: benjixx Owned by: nobody
Component: Generic views Version: master
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

Nearly all generic views use the parameter template_name to provide a custom template for rendering purposes.

But, the generic view django.views.generic.simple.direct_to_template uses the parameter template instead of template_name for exactly the same.

This is an inconsistency that probably should be fixed before releasing 1.0.

Change History (3)

comment:1 Changed 7 years ago by mtredinnick

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to wontfix
  • Status changed from new to closed

Not worth it. It would break every piece of code using that template for no real reason. You don't just switch on generic view for another with no other changes, so changing this at the time isn't a real hardship. Yes, it might be nice if we were starting from scratch, but introducing random backwards-incompatible changes that don't really improve functionality isn't a good idea at the moment.

comment:2 Changed 7 years ago by benjixx

What about officially changing it to template_name, and mention the use of template_name in the docs, but still keeping silent support for the old template parameter.
This wouldn't break backwards compatibility, but rather promotes the use of the commonly-used parameter template_name.

Support for the old template parameter may be dropped in a future release.

In the case that this ticket will be accepted I could provide a patch.

comment:3 Changed 4 years ago by jacob

  • milestone 1.0 deleted

Milestone 1.0 deleted

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