Changes between Initial Version and Version 1 of Ticket #5324


Ignore:
Timestamp:
Sep 3, 2007, 2:51:05 AM (17 years ago)
Author:
Malcolm Tredinnick
Comment:

(Tweaked ticket formatting slightly).

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #5324

    • Property Owner changed from Adrian Holovaty to Malcolm Tredinnick
  • Ticket #5324 – Description

    initial v1  
    33For instance, assuming I have users, some of whom are in group Editors, some in group Sales, and most are not in a group at all.
    44
    5  1. from django.contrib.auth.models import User
    6  2. user_qs = User.objects.all() # all users
    7  3. non_editor_users = user_qs.exclude(groups__name='Editors') # should be all users excluding those in group Editors
     5{{{
     6#!python
     7from django.contrib.auth.models import User
     8user_qs = User.objects.all() # all users
     9non_editor_users = user_qs.exclude(groups__name='Editors') # should be all users excluding those in group Editors
     10}}}
    811
    9 The set wrongly returned from (3) is actually the set of users who are in Sales but not in Editors - it fails to include those users who have no group at all.
     12The set wrongly returned is actually the set of users who are in Sales but not in Editors - it fails to include those users who have no group at all.
    1013
    1114The reason is the sql clause generated, which is doing
Back to Top