Code

Opened 7 years ago

Closed 7 years ago

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

Download all attachments as: .zip

Change History (8)

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

Patch to django.contrib.comments.views methods

comment:1 Changed 7 years ago by adrian

  • Component changed from Contrib apps to django.contrib.comments

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

  • Has patch set
  • Triage Stage changed from Unreviewed to Accepted

Changed 7 years ago by __hawkeye__

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

comment:3 Changed 7 years ago by __hawkeye__

  • Owner changed from nobody to __hawkeye__
  • Status changed from new to assigned
  • Summary changed from Patch to add 'extra_context' and 'context_processors' to django.contrib.comments to [patch] Views in django.contrib.comments should allow 'extra_context' and 'context_processors' arguments
  • Triage Stage changed from Accepted to Ready 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 7 years ago by __hawkeye__

  • Keywords extra_context, sprintsept14 added; extra_context removed

comment:5 Changed 7 years ago by adrian

  • Resolution set to fixed
  • Status changed from assigned to closed

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

comment:6 Changed 3 years ago by jacob

  • milestone 1.0 beta deleted

Milestone 1.0 beta deleted

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.