|
|
|
@ -8,6 +8,7 @@ from .models import Shift
|
|
|
|
|
from .forms import TeamBackupForm
|
|
|
|
|
from datetime import timedelta
|
|
|
|
|
from django.db.models import DateTimeField
|
|
|
|
|
from datetime import date, datetime, time
|
|
|
|
|
|
|
|
|
|
# Create your views here.
|
|
|
|
|
@login_required
|
|
|
|
@ -64,6 +65,8 @@ def terminal(request):
|
|
|
|
|
help_wanted = Q(required_helpers__gt=F("reg_count")) | Q(required_helpers=0) & Q(
|
|
|
|
|
room__required_helpers__gt=F("reg_count")
|
|
|
|
|
)
|
|
|
|
|
day = (timezone.now()-timedelta(hours=6))
|
|
|
|
|
day = datetime.combine(day, time.min)
|
|
|
|
|
shifts = (
|
|
|
|
|
Shift.with_reg_count()
|
|
|
|
|
.annotate(
|
|
|
|
@ -74,6 +77,8 @@ def terminal(request):
|
|
|
|
|
)
|
|
|
|
|
.filter(
|
|
|
|
|
help_wanted,
|
|
|
|
|
start_at__gte=day + timedelta(hours=5),
|
|
|
|
|
start_at__lte=day + timedelta(hours=29),
|
|
|
|
|
end_at__gte=timezone.now(),
|
|
|
|
|
deleted=False,
|
|
|
|
|
)
|
|
|
|
|