Re: best practice for lookup

2007-02-26 Thread RajeshD
> from schools.models import School > def schools(request, country, city) > schools = School.objects.? Try this: schools = School.objects.filter(city__exact=city, city__country__exact=country) Basically, use double underscores in the query fields to traverse through your model heira

best practice for lookup

2007-02-26 Thread enquest
Consider the following setup: Class country holds all country's Class City holds all city's with a foreignkey to the country Class schools holds all schools with a foreingkey to city I want a url like ...school/country/city In that way I can get a list of all schools in a city from a country.