I have a model that looks like ...
class Person(models.Model):
name = models.CharField(max_length=50)
birthday = models.DateField()
def __unicode__(self):
return u'%s %s' % (self.name, self.birthday)
class Address(models.Model):
person = models.ForeignKey(Person)
address = models.CharField(max_length=150)
def __unicode__(self):
return u'%s %s' % (self.person, self.address)
class Anniversy(models.Model):
person = models.ForeignKey(Person)
anniversy = models.DateField()
def __unicode__(self):
return u'%s %s' % (self.person, self.anniversy)
If I want to print out all of the fields into an HTML table what would be the easiest way. I was thinking off getting all of the fields returned into a single list and then just enumerate through them ?
Thanks,