Given 2 models:

class Person(models.Model):
    first_name = models.CharField(max_length=255)
    last_name = models.CharField(max_length=255)

class PersonAttendance(models.Model):
    person = models.ForeignKey(Person)
    attend_date = models.DateField()

I need to produce a formset that lists all Person(s) and their 
PersonAttendance if it has been entered, and blank fields for Persons that 
have no PersonAttendance related record so their attendance can be filled 
in.

In SQL I guess this would be achieved using a LEFT JOIN on Person, but I 
can't work out how to get this working with the ORM and Django Formsets.

Any help would be greatly appreciated, I've been stumped on this for ages.

Thank you

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/2dRj9IjQwO4J.
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.

Reply via email to