Opened 18 years ago

Closed 17 years ago

Last modified 13 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: dev
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: no UI/UX: no

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@…> 18 years ago.
Patch to django.contrib.comments.views methods
ticket_3091__rev_6186.diff (7.6 KB ) - added by Ben Slavin 17 years ago.
All comment views now support 'extra_context' and 'context_processors' arguments.

Download all attachments as: .zip

Change History (8)

by Eric Floehr <eric@…>, 18 years ago

Attachment: comments.patch added

Patch to django.contrib.comments.views methods

comment:1 by Adrian Holovaty, 18 years ago

Component: Contrib appsdjango.contrib.comments

comment:2 by Simon G. <dev@…>, 18 years ago

Has patch: set
Triage Stage: UnreviewedAccepted

by Ben Slavin, 17 years ago

Attachment: ticket_3091__rev_6186.diff added

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

comment:3 by Ben Slavin, 17 years ago

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 by Ben Slavin, 17 years ago

Keywords: sprintsept14 added

comment:5 by Adrian Holovaty, 17 years ago

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 by Jacob, 13 years ago

milestone: 1.0 beta

Milestone 1.0 beta deleted

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