#28082: Pull request #8364: BaseDateListView should pass all context to 
subclasses
-------------------------------------+-------------------------------------
               Reporter:  leon-      |          Owner:  nobody
  matthews                           |
                   Type:             |         Status:  new
  Cleanup/optimization               |
              Component:  Generic    |        Version:  master
  views                              |
               Severity:  Normal     |       Keywords:  BaseDateListView
           Triage Stage:             |      Has patch:  0
  Unreviewed                         |
    Needs documentation:  0          |    Needs tests:  0
Patch needs improvement:  0          |  Easy pickings:  0
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
 Pass the extra_content from get_dated_items() as kwargs into
 get_context_data() to allow users access to it.

 BaseDateListView.get() currently modifies the context after calling
 get_context_data(), which prevents users from access those data in their
 base classes. I ran into this suprising quirk when I wanted to access the
 current month in my MonthArchiveView subclass's get_context_data().

 I have created a GitHub pull request
 https://github.com/django/django/pull/8364

 (To really tidy things up, we could have all instances get_dated_items()
 return a single dictionary that we pass to get_context_data as kwargs, but
 I am a realist on occasion...)

--
Ticket URL: <https://code.djangoproject.com/ticket/28082>
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/056.c0f0cc4d00bb09045de940bbf3f564f7%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to