How to query ManyToManyFields

2008-02-21 Thread Albert Hopkins
I have a model with a M2M field and I want to filter based on the field being empty. How do I do this? I tried MyModel.objects.filter(m2mfield=[]) but that raises a (MySQL) exception. -a --~--~-~--~~~---~--~~ You received this message because you are subscrib

Re: How to query ManyToManyFields

2008-02-21 Thread Brett Hoerner
On Thu, Feb 21, 2008 at 5:06 PM, Albert Hopkins <[EMAIL PROTECTED]> wrote: > I have a model with a M2M field and I want to filter based on the field > being empty. How do I do this? I tried > MyModel.objects.filter(m2mfield=[]) but that raises a (MySQL) exception. Is this what you want? MyM

Re: How to query ManyToManyFields

2008-02-22 Thread Albert Hopkins
On Thu, 2008-02-21 at 17:17 -0600, Brett Hoerner wrote: > On Thu, Feb 21, 2008 at 5:06 PM, Albert Hopkins <[EMAIL PROTECTED]> wrote: > > I have a model with a M2M field and I want to filter based on the field > > being empty. How do I do this? I tried > > MyModel.objects.filter(m2mfield=[])