Wednesday, May 4, 2011

stop repetition in template

hello friends,
i have database of colleges.
i want to show all cities

so what is did is..
in template..

{% for college in list %}
{{college.city}}
{% endfor %}

in views.py

def list(request):
college_list=College.objects.all()
return render_to_response(
'college/list.html',
{'list':college_list}
)

so suppose i have two colleges in one city so it is showing the city
name twice .. so how do i stop repetition..

--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate