On Thu, 2006-07-06 at 02:55 +0000, Lorin Hochstein wrote: > Malcolm Tredinnick wrote: > > On Wed, 2006-07-05 at 21:38 +0000, Lorin Hochstein wrote: > > > > One of these (all hypotheses related to any topic on the list) is easy: > > > > Hypothesis.objects.filter(topics__in = topics) > > > > Ah, nice and simple... Somehow I manage to miss that in the docs. > Initially, this wasn't working on my system, but a "svn up" fixed the > problem. :)
Oh, sorry.. I should have pointed that out; it is using a slightly new feature. Russell Keith-Magee added the ability to do queries over actual objects like this only last week. Previously you had to construct a list of the id values and pass that in. So on older versions (if you need to work on them) topics_id = [obj.id for obj in topics] hypotheses = Hypothesis.objects.filter(topics_in = topics_id) would work also (in fact, it still works). Regards, Malcolm --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~----------~----~----~----~------~----~------~--~---