Re: Finding details of a Model object, which do not have objects of a given M2M field

2008-01-26 Thread [EMAIL PROTECTED]
Doh, this is what happens when I post before my second dose of caffeine, there are no negative filters there is just the exclude method, so the original thing should be: blog = Blog.objects.get(pk=something) entries = blog.entry_set.exclude(user=some_user) On Jan 26, 11:41 am, shabda <[EMAIL PRO

Re: Finding details of a Model object, which do not have objects of a given M2M field

2008-01-26 Thread shabda
Should for a M2M field ModelClass.objects.all() be same as ModelClass.objects.filter(some_m2m = some_m2m) UNION ModelClass.objects.exclude(some_m2m = some_m2m)? If yes then probably there is a bug. To test define a model class as in [1]. Do the tests like in [2]. You .all() does not give same resu

Re: Finding details of a Model object, which do not have objects of a given M2M field

2008-01-26 Thread [EMAIL PROTECTED]
Blog.entry_set.filter(user__ne=some_uesr) On Jan 26, 6:14 am, shabda <[EMAIL PROTECTED]> wrote: > I have the model like, > > class Blog(models.Model): > url = models.URLField() > > class Entry(models.Model): > blog = models.ForeignKey(Blog) > user = models.ManyToManyField(User) > > Us

Finding details of a Model object, which do not have objects of a given M2M field

2008-01-26 Thread shabda
I have the model like, class Blog(models.Model): url = models.URLField() class Entry(models.Model): blog = models.ForeignKey(Blog) user = models.ManyToManyField(User) User is contrib.auth.db.USER Now I given a blog and a user I need to find out all the Entry objects which are a det