mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-22 19:33:11 +00:00
Merge branch 'search_function' into 'dev'
Add start date recherche adhérents See merge request federez/re2o!365
This commit is contained in:
commit
dfc2eecae6
1 changed files with 6 additions and 6 deletions
|
@ -59,7 +59,7 @@ def all_adherent(search_time=None):
|
||||||
vente__in=Vente.objects.filter(
|
vente__in=Vente.objects.filter(
|
||||||
facture__in=Facture.objects.all().exclude(valid=False)
|
facture__in=Facture.objects.all().exclude(valid=False)
|
||||||
)
|
)
|
||||||
).filter(date_end__gt=search_time)
|
).filter(Q(date_start__lt=search_time) & Q(date_end__gt=search_time))
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
).distinct()
|
).distinct()
|
||||||
|
@ -71,7 +71,7 @@ def all_baned(search_time=None):
|
||||||
search_time = timezone.now()
|
search_time = timezone.now()
|
||||||
return User.objects.filter(
|
return User.objects.filter(
|
||||||
ban__in=Ban.objects.filter(
|
ban__in=Ban.objects.filter(
|
||||||
date_end__gt=search_time
|
Q(date_start__lt=search_time) & Q(date_end__gt=search_time)
|
||||||
)
|
)
|
||||||
).distinct()
|
).distinct()
|
||||||
|
|
||||||
|
@ -82,7 +82,7 @@ def all_whitelisted(search_time=None):
|
||||||
search_time = timezone.now()
|
search_time = timezone.now()
|
||||||
return User.objects.filter(
|
return User.objects.filter(
|
||||||
whitelist__in=Whitelist.objects.filter(
|
whitelist__in=Whitelist.objects.filter(
|
||||||
date_end__gt=search_time
|
Q(date_start__lt=search_time) & Q(date_end__gt=search_time)
|
||||||
)
|
)
|
||||||
).distinct()
|
).distinct()
|
||||||
|
|
||||||
|
@ -94,8 +94,8 @@ def all_has_access(search_time=None):
|
||||||
search_time = timezone.now()
|
search_time = timezone.now()
|
||||||
return User.objects.filter(
|
return User.objects.filter(
|
||||||
Q(state=User.STATE_ACTIVE) &
|
Q(state=User.STATE_ACTIVE) &
|
||||||
~Q(ban__in=Ban.objects.filter(date_end__gt=search_time)) &
|
~Q(ban__in=Ban.objects.filter(Q(date_start__lt=search_time) & Q(date_end__gt=search_time))) &
|
||||||
(Q(whitelist__in=Whitelist.objects.filter(date_end__gt=search_time)) |
|
(Q(whitelist__in=Whitelist.objects.filter(Q(date_start__lt=search_time) & Q(date_end__gt=search_time))) |
|
||||||
Q(facture__in=Facture.objects.filter(
|
Q(facture__in=Facture.objects.filter(
|
||||||
vente__in=Vente.objects.filter(
|
vente__in=Vente.objects.filter(
|
||||||
cotisation__in=Cotisation.objects.filter(
|
cotisation__in=Cotisation.objects.filter(
|
||||||
|
@ -104,7 +104,7 @@ def all_has_access(search_time=None):
|
||||||
facture__in=Facture.objects.all()
|
facture__in=Facture.objects.all()
|
||||||
.exclude(valid=False)
|
.exclude(valid=False)
|
||||||
)
|
)
|
||||||
).filter(date_end__gt=search_time)
|
).filter(Q(date_start__lt=search_time) & Q(date_end__gt=search_time))
|
||||||
)
|
)
|
||||||
)))
|
)))
|
||||||
).distinct()
|
).distinct()
|
||||||
|
|
Loading…
Reference in a new issue