Django

Code

Ticket #5298 (new)

Opened 1 year ago

Last modified 3 months ago

The extra_context keyword argument should be available in the auth app views

Reported by: peadalo@gmail.com Assigned to: durdinator
Milestone: Component: Contrib apps
Version: SVN Keywords: extra_context auth "generic views" sprintsept14
Cc: adurdin@gmail.com Triage Stage: Accepted
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description

Enhancement Request

When using the views in the auth app (django.contrib.auth.views), it would be nice to have the option of passing extra context variables through the views and to the templates. This seems to be possible with django generic views by passing a dictionary to the "extra_context" keyword argument.

This would be useful for passing context variables to the login/logout templates which are specific to only those templates and therefore don't belong in the RequestContext? context processors.

Attachments

fix-extra_context.diff (3.9 kB) - added by jordanl on 09/14/07 14:47:51.
Adds support for passing extra_context to the views in django.contrib.auth.views
patch_5298.diff (5.1 kB) - added by durdinator on 09/14/07 14:58:48.
patch_5298.2.diff (5.1 kB) - added by durdinator on 09/14/07 15:18:59.
django.contrib.auth.views.patch (4.5 kB) - added by Jj <jjdelc@gmail.com> on 06/02/08 18:07:53.
extra_context added to views

Change History

09/02/07 04:20:41 changed by Simon G. <dev@simon.net.nz>

  • needs_better_patch changed.
  • component changed from Uncategorized to Metasystem.
  • needs_tests changed.
  • version changed from 0.96 to SVN.
  • owner changed from jacob to adrian.
  • needs_docs changed.
  • stage changed from Unreviewed to Design decision needed.

Want to write a patch?

09/11/07 09:16:35 changed by russellm

  • component changed from Metasystem to Contrib apps.
  • stage changed from Design decision needed to Accepted.

Seems like a reasonable idea.

09/14/07 14:19:25 changed by durdinator

  • owner changed from nobody to durdinator.

09/14/07 14:47:51 changed by jordanl

  • attachment fix-extra_context.diff added.

Adds support for passing extra_context to the views in django.contrib.auth.views

09/14/07 14:48:54 changed by jordanl

  • has_patch set to 1.

09/14/07 14:50:10 changed by jordanl

The patch is pretty trivial. Not sure if this even needs tests.

09/14/07 14:58:48 changed by durdinator

  • attachment patch_5298.diff added.

09/14/07 15:18:59 changed by durdinator

  • attachment patch_5298.2.diff added.

09/14/07 15:25:23 changed by durdinator

patch_5298.diff has the same semantics for extra_context as the generic views: i.e. it calls callables in the dict.

patch_5298.2.diff adds a paragraph to the docs about it.

09/14/07 15:34:19 changed by gkelly

  • keywords changed from extra_context auth "generic views" to extra_context auth "generic views" sprintsept14.

09/14/07 16:35:35 changed by Simon G. <dev@simon.net.nz>

  • stage changed from Accepted to Ready for checkin.

09/15/07 06:23:56 changed by russellm

  • stage changed from Ready for checkin to Accepted.

Mostly fine - but why the 'update_context_from_dict' method? Why not just use Context.update()?

10/23/07 08:30:38 changed by durdinator

  • cc set to adurdin@gmail.com.

I was following the example of the extra_context argument to generic views, whereby callables are called -- for comparison see http://code.djangoproject.com/browser/django/trunk/django/views/generic/list_detail.py#L88

06/02/08 18:07:53 changed by Jj <jjdelc@gmail.com>

  • attachment django.contrib.auth.views.patch added.

extra_context added to views

06/02/08 18:09:38 changed by Jj <jjdelc@gmail.com>

I just added the django.contrib.auth.views.patch patch that adds extra_context support to the auth views, It has minimal impact in the overall code and should not affect current code.


Add/Change #5298 (The extra_context keyword argument should be available in the auth app views)




Change Properties
Action