Hi, i don't know show my data in template ok explain my models

models.py

class Country(..):
    name = charfield...

   def __unicode__(..)
       return self.name

class Gender(..):
    name = charfield...

   def __unicode__(..)
       return self.name

class Player(..):
    country = FK(country)
    gender = FK(Gender)
    name = charfield..
    other_fields = charfield...

   def __unicode__(..)
       return self.name


ok i need show in front this ways

Country
    ---Gender
           ---Player


EU

  |
  Metal
      |-- dave mustaine
      |-- James Hetfield

      |-- other

  Romantic

      |-- name1

      |-- name2

      |-- other

   POP

       |-- NamePop1

       |-- namePop2

       |-- other



how to that in template?

views.py
any idea in my views used this
country = Country.objects.all()
gender = Gender.objects.all()
player = Player.objects.all()

template
index.html
for con in country:
   {{con}}
   for gen in gender:
      player for {{gen}}
         for pla in player:
            if pla.gender == gen and pla.country == con :
                <ul>
                   <li>{{pla.name}}

but this no working well :/
any idea to do this?

Cheers

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAM-7rO2KuAm7RvFXPLP%2BpL-zQ3N%2BSN-ZP1WLkTkpyVdBKc%2BH%3Dg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to