Re: Template: Foreign Key

2012-05-19 Thread Fady Kamal
actually it worked even without the the set.all ,thanks for help On Sat, May 19, 2012 at 4:51 AM, Kurtis Mullins wrote: > Whoops -- that might need to be 'house.people_set.all'. Sorry. > > > On Fri, May 18, 2012 at 10:50 PM, Kurtis Mullins > wrote: > >> Try something along these lines (Note: I'm

Re: Template: Foreign Key

2012-05-18 Thread Kurtis Mullins
Whoops -- that might need to be 'house.people_set.all'. Sorry. On Fri, May 18, 2012 at 10:50 PM, Kurtis Mullins wrote: > Try something along these lines (Note: I'm switching up your variable > names a bit to make it easier to read) > > {% for house in houses %} > {{ house.name }} > {% for

Re: Template: Foreign Key

2012-05-18 Thread Kurtis Mullins
Try something along these lines (Note: I'm switching up your variable names a bit to make it easier to read) {% for house in houses %} {{ house.name }} {% for person in house.people.all %} {{ person.name }} {% endfor %} {% endfor %} I just wrote that code block pretty quickly

Re: Template: Foreign Key

2012-05-18 Thread Fady Kamal
it's not working with me On Tuesday, June 30, 2009 10:43:15 AM UTC+2, russelson wrote: > > Hi, > > I'm new to django > > I have two models > > #models.py > > class House(models.Model): > name = models.CharField(blank=True, max_length=50) > > class People(models.Model): > name = mode

Re: Template: Foreign Key

2009-06-30 Thread Kenneth Gonsalves
On Tuesday 30 June 2009 14:13:15 russelson wrote: > #models.py > > class House(models.Model): > name = models.CharField(blank=True, max_length=50) > > class People(models.Model): > name = models.CharField(blank=True, max_length=50) > house = models.ForegnKey(House) > > #views.py > def

Template: Foreign Key

2009-06-30 Thread russelson
Hi, I'm new to django I have two models #models.py class House(models.Model): name = models.CharField(blank=True, max_length=50) class People(models.Model): name = models.CharField(blank=True, max_length=50) house = models.ForegnKey(House) #views.py def house_list(request):