Hi --

My model have three classes:  Continent, Country, City

class Continent(models.Model):
    name = models.CharField(maxlength=60)

class Country(models.Model):
    country_name = models.CharField(maxlength=60)
    continent = models.ForeignKey(Continent)

class City(models.Model):
    city_name = models.CharField(maxlength=60)
    city = models.ForeignKey(Country)


I want to display a page listing the countries, by continent and
number of cities in database.

-------- Sample output -----------

Continent
- Country (number of cities)

Africa

- Egypt (3)
- Kenia (62)

Europa

- Belgium (4)
- Germany (8)

---------- end  sample output -----------

I worked through chapter 1-7 in Djangobook and sample application on
djangoproject site. I can display a lists via generic views, tried
REGROUP option etc.. but battle to get it working.

Any ideas on where to start or link to sample will be much
appreciated.

Many Thanks
Liam

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