#5763: Queryset doesn't have a "not equal" filter operator
-------------------------------------+-------------------------------------
               Reporter:  jdetaeye   |        Owner:  nobody
                 Status:  reopened   |    Milestone:
              Component:  Database   |      Version:  SVN
  layer (models, ORM)                |     Keywords:  qs-rf
             Resolution:             |    Has patch:  0
           Triage Stage:  Design     |  Needs tests:  0
  decision needed                    |
    Needs documentation:  0          |
Patch needs improvement:  0          |
-------------------------------------+-------------------------------------

Comment (by anonymous):

 I would love to see this.  Case in point:

 {{{
         return self.filter(
             group__sites=Site.objects.get_current(),
             user=user
         ).exclude(
             group__status=GROUP_REMOVED,
             status=MEMBER_STATUS_BANNED,
             subscription=SUBSCRIPTION_NEVER
         )
 }}}

 Generates:

 {{{
    SELECT ...
    INNER JOIN ...
    WHERE (
       "groups_group_sites"."site_id" = 1  AND
       "groups_membership"."user_id" = 17  AND NOT (
          "groups_membership"."status" = 99  AND
          "groups_group"."status" = 3  AND (
             "groups_membership"."subscription" = 0  AND
             "groups_membership"."subscription" IS NOT NULL
          )
       )
    ) ORDER BY "groups_membership"."status" DESC
 }}}

 Would like to see instead:

 {{{
 "groups_group_sites"."site_id" = 1  AND
 "groups_membership"."user_id" = 17  AND
 "groups_membership"."status" != 99  AND
 "groups_group"."status" != 3  AND
 "groups_membership"."subscription" != 0  AND
 "groups_membership"."subscription" IS NOT NULL
 }}}

-- 
Ticket URL: <http://code.djangoproject.com/ticket/5763#comment:11>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to