On Wed, Aug 10, 2011 at 7:06 PM, bruno desthuilliers
<[email protected]> wrote:
> On 10 août, 16:35, Reinout van Rees <[email protected]> wrote:
>>
>> Best solution: calculate that url in your python view code and just pass
>> it along in the context.
>
> Definitly not the best solution if this has to work for more than
> exactly ONE view.
>

So instead of typing this in multiple views:

context['some_var'] = request.GET.get('name')

is somehow more effort than typing this in multiple templates:

{% url foo request.POST|mycustomattrgetter:"name" %}

The template code could be inherited, but then placing the variable in
a context could also be done by a template context processor. Where
you have many views that require the same context variables, this is
easier imo.

Remember that you can pass a custom list of template context
processors to a render_to_foo() call, in addition to
settings.TEMPLATE_CONTEXT_PROCESSORS.

Cheers

Tom

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to