hi, Tom

thanks for the reply

what I actually want to do is to
list several templates in the render_to_response
function and be able to choose which one to use

can I choose which template to use?

thanks again, and let me know if my question is clear enough

On Mon, Nov 7, 2011 at 12:18 PM, Tom Evans <tevans...@googlemail.com> wrote:

> On Mon, Nov 7, 2011 at 3:09 PM, jay K. <jay.developer2...@gmail.com>
> wrote:
> >
> > Hello
> >
> > I have a view with the following render_to_template function
> >
> > ...
> >
> > return render_to_response( 'template/template.html', {var'': var},
> > context_instance=RequestContext(request))
> > ...
> >
> > I want the render_to_response to point to more than 1 template. So far
> > I've tried adding a dictionary of templates but it gives me an error,
> > maybe I'm
> > not doing it properly
> >
> > If anyone can teach me how to do it I'd really appreciate it
> >
> > thanks
> >
>
> What do you want to happen with your list of templates? Do you want to
> find the first one that exists and render that one? If so, you can
> pass an iterable to render_to_response instead of a single template
> name, and it will render the first available one, see the docs:
>
> https://docs.djangoproject.com/en/1.3/topics/http/shortcuts/#id1
>
> Otherwise, you will have to explain what you are trying to do, as it
> is non-obvious.
>
> 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 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.
>
>

-- 
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