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 PROTECTED]> wrote:
> 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 results
> as .filter() + .exclude() .
>
> BTW, there is no __ne field lookup.[3]
> [1]http://dpaste.com/32649/
> [2]http://dpaste.com/32648/
> [3]http://www.djangoproject.com/documentation/db-api/
>
> On Jan 26, 8:54 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
> wrote:
>
> > 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)
>
> > > 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 detail of this blog and do not have the given user. How
> > > can I do that?
--~--~---------~--~----~------------~-------~--~----~
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?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to