ManyToMany filtering

2009-10-04 Thread Weeble
I have a model that represents interdependent tasks. A task cannot be started until all of its prerequisite tasks have been completed. I want to find all the tasks which are ready to start, i.e. all their prerequisite tasks (if any) have been completed. This is the relevant part of the model:

Re: ManytoMany filtering

2006-09-19 Thread Gabriel Puliatti
On Wed, 2006-09-20 at 10:40 +1000, Malcolm Tredinnick wrote: > > Homework.objects.filter(course__in = > list(classesjoined.all())) > > The list() call may be superfluous there, but I have a recollection > that > we don't handle iterators smoothly in filter() calls. I may be >

Re: ManytoMany filtering

2006-09-19 Thread Malcolm Tredinnick
On Tue, 2006-09-19 at 18:59 -0500, Gabriel Puliatti wrote: > On Wed, 2006-09-20 at 09:35 +1000, Malcolm Tredinnick wrote: > > It's possible that I've guessed at the missing details incorrectly. In > > that case, could you give us an example of what "classesjoined" contains > > (print it out;

Re: ManytoMany filtering

2006-09-19 Thread Gabriel Puliatti
On Wed, 2006-09-20 at 09:35 +1000, Malcolm Tredinnick wrote: > It's possible that I've guessed at the missing details incorrectly. In > that case, could you give us an example of what "classesjoined" contains > (print it out; don't guess at what you think it should it be) and maybe > show the

Re: ManytoMany filtering

2006-09-19 Thread Malcolm Tredinnick
On Tue, 2006-09-19 at 17:41 -0500, Gabriel Puliatti wrote: > Hello. I'm trying to get some database objects using objects.get. > However, I only want to get those objects which match a certain > manytomany. Is there a way to do this? > > For example, each student has multiple subjects and each

ManytoMany filtering

2006-09-19 Thread Gabriel Puliatti
Hello. I'm trying to get some database objects using objects.get. However, I only want to get those objects which match a certain manytomany. Is there a way to do this? For example, each student has multiple subjects and each homework has one subject assigned to it. Then, there is a Subject