contrib.syndication.views: Add hook for getting extra context in feed templates
|Reported by:||Paul Winkler||Owned by:||Zbigniew Siciarz|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
This seems to me like a useful low-impact hook for authors of Feed subclasses...
I was writing one today and wished I had such a hook.
It would be intentionally similar to the
hook on class-based views.
Usage would look like:
class MyFeed(Feed): def get_context_data(**kwargs): context = super(MyFeed, self).get_context_data(**kwargs) context['foo'] = settings.FOO context['more_things'] = app.models.Things.objects.filter(...) return context
The description_template and title_template could then make use of the extra context variables.
Attaching a patch; will write tests if this seems worthwhile.
Change History (8)
comment:2 Changed 4 years ago by
|Triage Stage:||Unreviewed → Accepted|
comment:5 Changed 4 years ago by
|Owner:||changed from nobody to Zbigniew Siciarz|
|Status:||new → assigned|