Update dashboard
This commit is contained in:
parent
c8b8f4ab82
commit
b2b5005fbb
|
@ -22,6 +22,8 @@ from django.conf import settings
|
|||
from .models import Citation
|
||||
from jarvis.tools.models import from_date_to_week_number
|
||||
|
||||
from jarvis.tools.models import Season
|
||||
|
||||
from weasyprint import HTML, CSS
|
||||
import pendulum
|
||||
|
||||
|
@ -122,15 +124,20 @@ def home(request):
|
|||
Gymnast.objects.filter(known_skills__created_at__gt=request.user.last_login)
|
||||
)
|
||||
|
||||
season = Season()
|
||||
limit_date = today - timedelta(days=14)
|
||||
waiting_update_gymnast = Gymnast.objects.exclude(
|
||||
Q(is_active=False)
|
||||
| Q(wellbeings__created_at__gte=limit_date)
|
||||
| Q(points__created_at__gte=limit_date)
|
||||
| Q(chronos__created_at__gte=limit_date)
|
||||
| Q(injuries__created_at__gte=limit_date)
|
||||
| Q(known_skills__created_at__gte=limit_date)
|
||||
).distinct()
|
||||
waiting_update_gymnast = (
|
||||
Gymnast.objects.filter(season_informations__season=season)
|
||||
.exclude(
|
||||
Q(is_active=False)
|
||||
| Q(wellbeings__created_at__gte=limit_date)
|
||||
| Q(points__created_at__gte=limit_date)
|
||||
| Q(chronos__created_at__gte=limit_date)
|
||||
| Q(injuries__created_at__gte=limit_date)
|
||||
| Q(known_skills__created_at__gte=limit_date)
|
||||
)
|
||||
.distinct()
|
||||
)
|
||||
|
||||
nb_active_gymnast = Gymnast.objects.filter(is_active=True).count()
|
||||
nb_event = Event.objects.all().count()
|
||||
|
|
Loading…
Reference in New Issue