Hi,
In my application I have a model that looks like this:
class Talk(models.Model):
title = models.CharField(max_length=200, primary_key=True)
speaker = models.CharField(max_length=200)
date_of_talk = models.DateField('date_of_talk')
def __unicode__(self):
return self.title
class Member(models.Model):
name = models.CharField(max_length=200)
telephone_number = models.CharField(max_length=200)
email_address = models.CharField(max_length=200)
membership_type = models.CharField(max_length=1, choices=MEMBERSHIP_TYPES)
membership_number = models.CharField(max_length=200, primary_key=True)
def __unicode__(self):
return self.name
class Event_Attendance(models.Model):
talk = models.ForeignKey('Talk')
membersAttended = models.ForeignKey('Member')
def __unicode__(self):
return '%s attended %s' %(unicode(self.membersAttended), unicode(self.talk))
And I want to be able to pull out all the results from the Event_Attendance
model when i input a talk. This is so that i can get the names of the people that attended it. Every thing that I have tried has failed such as:
a = Event_Attendance(talk="Meteors")
Has anyone else got any ideas?
Thanks in Advance,
Dean