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):
houses = House.objects.all()
return render_to_response('test/house_list.html', {'object_list':
houses})
#house_list.html
{% for object in object_list %}
{{ object.name }}
{{ object.people.name }} #!?!?
{% endfor %}
How do i retrieve the information in the People model?
Please advice
Thanks in advance
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---