On Tue, Dec 6, 2011 at 2:24 PM, Felipe Morales wrote:
> Hi,
>
> Maybe I can't understand you, but try with
>
> u = User.objects.filter(groups__name__in =
> gruppe).exclude(groups__name__in='Timesheet-Boss','TimeSheet-Manager','Projektleiter','Normal-User','Manager']).values_list('id',
> 'username'
Amazing12 queries left and that's hell of a lot faster J
Thank you guys !
Von: django-users@googlegroups.com [mailto:django-users@googlegroups.com] Im
Auftrag von Felipe Morales
Gesendet: Dienstag, 06. Dezember 2011 15:24
An: django-users@googlegroups.com
Betreff: Re: help optim
Hi,
Maybe I can't understand you, but try with
u = User.objects.filter(groups__name__in = gruppe).exclude(groups__name__in=
*'Timesheet-Boss'*,*'TimeSheet-Manager'*,*'Projektleiter'*,*'Normal-User'*,*
'Manager'*]).values_list('id', 'username')
2011/12/6 Szabo, Patrick (LNG-VIE)
> Hi,
>
>
On Tue, Dec 6, 2011 at 1:42 PM, Szabo, Patrick (LNG-VIE)
wrote:
> Hi,
>
>
>
> I’v got this piece of code:
>
>
>
> def get_my_choices(gruppe):
>
> users = User.objects.all()
>
> choices_list = ()
>
> for user in users:
>
> try:
>
> for groupe in gruppe:
>
>
Hi,
I'v got this piece of code:
def get_my_choices(gruppe):
users = User.objects.all()
choices_list = ()
for user in users:
try:
for groupe in gruppe:
for groupe2 in user.groups.all():
if groupe2 == groupe and (user
5 matches
Mail list logo