Re: Multi-table lookup ... Pt.2

2007-09-11 Thread Chris Brand
dbee wrote: >When the reminders_list in the 'if' statement below gets assigned, >there doesn't seem to be a problem. But when I reference it at the >bottom of the code segment. I end up with the programming error at the >bottom of the page. > > Do you know which line triggers the error ? It's

Multi-table lookup ... Pt.2

2007-09-11 Thread dbee
I posted this here before a few days ago but I couldn't get a conclusive answer, so I thought I'd try again. I'm pretty much stuck on this one and I'm getting a weird error that I don't really understand. When the reminders_list in the 'if' statement below gets assigned, there doesn't seem to be

Re: Multi-table lookup ... ?

2007-09-10 Thread dbee
As far as I understand it, campaign.groups_set would only be relevant for a 'backwards' relationship. Whereas in this case campaign.group is actually relevant. Yes, I tried it - and I tried many other combinations as well ... Thanks On Sep 10, 10:18 pm, Chris Brand <[EMAIL PROTECTED]> wrote: >

Re: Multi-table lookup ... ?

2007-09-10 Thread Chris Brand
dbee wrote: >Hmm, I'm not entirely sure where you got the campaign.groups_set >construction there James. There is no campaign.groups_set afaik ... > > > Probably from here : http://djangoproject.com/documentation/db-api/#related-objects Did you try it or just assume that James made a mistake

Re: Multi-table lookup ... ?

2007-09-10 Thread dbee
Hmm, I'm not entirely sure where you got the campaign.groups_set construction there James. There is no campaign.groups_set afaik ... I've been trying to mess about with it and what I've gotten so far is this ... # Get the details of the reminders to whom this campaign will be sent

Re: Multi-table lookup ... ?

2007-09-08 Thread James Bennett
On 9/8/07, dbee <[EMAIL PROTECTED]> wrote: > If I have a campaign object that has 3 groups in it. And I want to > find all the reminder objects that are in those groups ... unless of > course it's a campaign with no groups in it - in which case I'd like > all the reminders associated with that

Multi-table lookup ... ?

2007-09-08 Thread dbee
# People who need to be reminded class Reminders (models.Model): userProfile = models.ForeignKey(UserProfile) groups = models.ManyToManyField(Groups, blank=True, null=True) campaigns = models.ManyToManyField(Campaigns, blank=True, null=True) # Campaign that needs to be sent out to

Multi-table lookup ... ?

2007-09-08 Thread dbee
# People who need to be reminded class Reminders (models.Model): userProfile = models.ForeignKey(UserProfile) groups = models.ManyToManyField(Groups, blank=True, null=True) campaigns = models.ManyToManyField(Campaigns, blank=True, null=True) # Campaign that needs to be sent out to