actually i want both.. like
LIST OF ALL COLLEGES:
college1
city1
college2
city2
college3
city3
LIST OF CITIES
city1
city2
city3
{but is city2 = city3}
then it would show :
LIST OF ALL COLLEGES:
college1
city1
college2
city2
college3
city3
LIST OF CITIES
city1
city2
--
I like your second solution a lot better than mine. I've never seen {%
ifchanged %} used properly before.
Brian
On Wed, May 4, 2011 at 1:19 PM, Javier Guerra Giraldez
wrote:
> On Wed, May 4, 2011 at 11:42 AM, pankaj sharma
> wrote:
> > in template..
> >
> > {% for college in list
On Wed, May 4, 2011 at 11:42 AM, pankaj sharma
wrote:
> in template..
>
> {% for college in list %}
> {{college.city}}
> {% endfor %}
>
> in views.py
>
> def list(request):
> college_list=College.objects.all()
> return render_to_response(
> 'coll
I would handle this at the views layer. Right now your queryset of
college_list is a list of colleges containing cities. In your view code I
would re-organize it to be a list of cities that contain colleges. Then you
can iterate through cities and get colleges. You can build this data
structure
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_
5 matches
Mail list logo