Perhaps the problem lies on the view code, are you passing the query data to the template? Is que query returning any data? Try posting the relevant code from your views.
Regards, Carlos Ruvalcaba El 15/10/2011 14:12, "Piotr Hosowicz" <phosow...@gmail.com> escribió: > Hello, > > I still do not understand how things are connected in Django. In > models.py I have: > > class CampaignManager(models.Manager): > pass > > class CampPeople(models.Model): > person = models.ForeignKey(Person) > camp = models.ForeignKey(Campaign) > docall = models.BooleanField(True) > called = models.BooleanField(False) > objects = CampaignManager() > > class Phone(models.Model): > # person = models.ForeignKey(Person) > phone = models.CharField(u"Telefon", max_length=255) > def __unicode__(self): > return "%s" % (unicode(self.phone) or "") > > class PersonPhonesManager(models.Manager): > pass > > class PersonPhones(models.Model): > person = models.ForeignKey(Person) > phone = models.ForeignKey(Phone) > objects = PersonPhonesManager() > def __unicode__(self): > return "%s" % (unicode(self.phone) or "") > > In the template I have: > > <table> > > {% for piplok in camppeople %} > {% if piplok.docall %} > <tr> > <td>{{ piplok.person.label }} > </td> > <td> > {{ personphones.phone }} > </td> > </tr> > {% else %} > NOT > {% endif %} > {% endfor %} > > </table> > > And I do not see any row output. > > Please help, > > Regards, > > Piotr Hosowicz > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to django-users@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.