Changes between Version 1 and Version 2 of Ticket #28943


Ignore:
Timestamp:
Dec 18, 2017, 9:07:52 PM (7 years ago)
Author:
James Pic
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #28943 – Description

    v1 v2  
    55TemplateView.render_to_response() should call its ContextMixin.get_context_data() method automatically is because TemplateView inherits from both TemplateResponseMixin, and ContextMixin which provides the get_context_data() method.
    66
    7 Currently, the workaround is to call TemplateResponse.get(request, *args, **kwargs), but users should really be calling what they mean to do instead: super().render_to_response()
     7Currently, the workaround is to call
     8{{{
     9# note usage of self in the method call
     10TemplateResponse.get(self, request, *args, **kwargs)
     11}}}
     12
     13However, users should really be calling what they mean to do instead:
     14
     15{{{
     16super().render_to_response()
     17}}}
     18
     19Then, then can still resolve {{ view }} in the template to add more variables.
Back to Top