Opened 10 years ago

Closed 9 years ago

Last modified 5 years ago

#3091 closed enhancement (fixed)

[patch] Views in django.contrib.comments should allow 'extra_context' and 'context_processors' arguments

Reported by: eric@… Owned by: Ben Slavin
Component: contrib.comments Version: master
Severity: normal Keywords: comments, freecomment, context, extra_context, sprintsept14
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

The current django.contrib.comments view code does not allow passing in additional context.

This patch adds extra_context and context_processors parameters to the django.contrib.comments views. I had the need to pass additional context for my templates into the comments "generic" views, and wanted to be able to pass the context in the same way I can for the other generic views. This patch to comments.py allows this.

With this patch, comments work the same way as other generic views. For example, to pass additional context in you may do:

urlpatterns = patterns('',
    (r'^comments/', include('django.contrib.comments.urls.comments'), {'extra_context': {'extra': 123}}),
)

Attachments (2)

comments.patch (3.1 KB) - added by Eric Floehr <eric@…> 10 years ago.
Patch to django.contrib.comments.views methods
ticket_3091__rev_6186.diff (7.6 KB) - added by Ben Slavin 9 years ago.
All comment views now support 'extra_context' and 'context_processors' arguments.

Download all attachments as: .zip

Change History (8)

Changed 10 years ago by Eric Floehr <eric@…>

Attachment: comments.patch added

Patch to django.contrib.comments.views methods

comment:1 Changed 10 years ago by Adrian Holovaty

Component: Contrib appsdjango.contrib.comments

comment:2 Changed 10 years ago by Simon G. <dev@…>

Has patch: set
Triage Stage: UnreviewedAccepted

Changed 9 years ago by Ben Slavin

Attachment: ticket_3091__rev_6186.diff added

All comment views now support 'extra_context' and 'context_processors' arguments.

comment:3 Changed 9 years ago by Ben Slavin

Owner: changed from nobody to Ben Slavin
Status: newassigned
Summary: Patch to add 'extra_context' and 'context_processors' to django.contrib.comments[patch] Views in django.contrib.comments should allow 'extra_context' and 'context_processors' arguments
Triage Stage: AcceptedReady for checkin

Diff is now from proper location. (trunk)

No backwards incompatible changes.

This change seems like a good idea, so promoting directly to 'Ready for checkin'. I won't be offended if it gets bumped to design decision needed though.

comment:4 Changed 9 years ago by Ben Slavin

Keywords: sprintsept14 added

comment:5 Changed 9 years ago by Adrian Holovaty

Resolution: fixed
Status: assignedclosed

(In [6236]) Fixed #3091 -- django.contrib.comments views now accept extra_context and context_processors arguments. Thanks, Eric Floehr and hawkeye

comment:6 Changed 5 years ago by Jacob

milestone: 1.0 beta

Milestone 1.0 beta deleted

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