We know that power MTV of Django.
Here is my question.

I have 3 list of "Thing", fruit,bread,wine, but they share a same
structure of template,I want to render them to on template like this:

view:
fruitList = thing.objects.filter(type='1')
breadList =  thing.objects.filter(type='2')
wineList =  thing.objects.filter(type='3')

template List.html :
{{for t in thingList}}
    {{t.name}}
{{endfor}}

Is there any possible that I could do this:

return render_to_response('All.html', RequestContext(request,
{'fruitList':fruitList,"breadList'',breadList,"wineList":wineList}))

template All.html:
{% include "List.html" %}   //but I don't know how to map the
fruitList to thingList.
{% include "List.html" %}   //but I don't know how to map the
breadList to thingList.
{% include "List.html" %}   //but I don't know how to map the wineList
to thingList.

Any help will be highly appreicate.

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