Re: Many-To-Many issue; trying to find a way around conditional id

2010-04-26 Thread Nick Serra
Can you be more clear on the exact result you're trying to achieve? Do you want to see, for a given high school, how many recruit objects are foreign keyed to it? On Apr 26, 7:38 am, Nuno Maltez wrote: > Are you saying that: > > collegelist = > college.current_objects.filter(collegechoices__scho

Re: Many-To-Many issue; trying to find a way around conditional id

2010-04-26 Thread Nuno Maltez
Are you saying that: collegelist = college.current_objects.filter(collegechoices__school=highschoolid).exclude(name='Undeclared').distinct().annotate(ccount=Count('collegechoices')) gives you the same results as collegelist = college.current_objects.exclude(name='Undeclared').distinct().annota

Re: Many-To-Many issue; trying to find a way around conditional id

2010-04-19 Thread Matt
Oops. That title should be "conditional if," of course. On Apr 19, 2:43 pm, Matt wrote: > Hoping you all can tell me what I'm doing that's stupid here. I have > three models: > > class highschool(models.Model): >     name = models.CharField(max_length=50) >     address = models.CharField(max_leng