Ticket #5468: patch_5468.diff
File patch_5468.diff, 861 bytes (added by , 17 years ago) |
---|
-
django/views/generic/simple.py
2 2 from django.template import loader, RequestContext 3 3 from django.http import HttpResponse, HttpResponsePermanentRedirect, HttpResponseGone 4 4 5 def direct_to_template(request, template, extra_context= {}, mimetype=None, **kwargs):5 def direct_to_template(request, template, extra_context=None, mimetype=None, **kwargs): 6 6 """ 7 7 Render a given template with any extra URL parameters in the context as 8 8 ``{{ params }}``. 9 9 """ 10 10 dictionary = {'params': kwargs} 11 if extra_context is None: extra_context = {} 11 12 for key, value in extra_context.items(): 12 13 if callable(value): 13 14 dictionary[key] = value()