This is actually one case where that probably won't work --
some_other_var is a dict that needs a specific key set to
object.field's value on each run through the loop, and it seems
ridiculous to make a copy of it for each object in object_list.

I think the only solution is going to be a big fancy template tag to
update the context -- although that seems like overkill.  Does the
ticket [1] relating to this need a design decision or just a patch?

[1] https://code.djangoproject.com/ticket/1199


On Dec 6, 7:49 am, Reinout van Rees <rein...@vanrees.org> wrote:
> On 06-12-11 02:05, Nan wrote:
>
> > So, yes, I know one can combine template filter arguments by quoting
> > them into a single concatenated string...  But what if one needs to do
> > something that amounts to the following?
>
> > {% for object in object_list %}
> >      {{ some_other_var|custom_filter(constant_string, object.field)|
> > some_other_filter|etc }}
> > {% endfor %}
>
> > Obviously one can't within the loop convert the argument list into a
> > string.  Is there any workaround for this that isn't horribly ugly?
>
> Sounds like your best bet is to try and do it in your Python view code
> instead of in your template.
>
> Reinout
>
> --
> Reinout van Rees                    http://reinout.vanrees.org/
> rein...@vanrees.org            http://www.nelen-schuurmans.nl/
> "If you're not sure what to do, make something. -- Paul Graham"

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

Reply via email to