|
|
@ -7,6 +7,7 @@ from .models import TeamBackup
|
|
|
|
from .models import Shift
|
|
|
|
from .models import Shift
|
|
|
|
from .forms import TeamBackupForm
|
|
|
|
from .forms import TeamBackupForm
|
|
|
|
from datetime import timedelta
|
|
|
|
from datetime import timedelta
|
|
|
|
|
|
|
|
from django.db.models import DateTimeField
|
|
|
|
|
|
|
|
|
|
|
|
# Create your views here.
|
|
|
|
# Create your views here.
|
|
|
|
@login_required
|
|
|
|
@login_required
|
|
|
@ -16,9 +17,15 @@ def worklist(request):
|
|
|
|
)
|
|
|
|
)
|
|
|
|
shifts = (
|
|
|
|
shifts = (
|
|
|
|
Shift.with_reg_count()
|
|
|
|
Shift.with_reg_count()
|
|
|
|
|
|
|
|
.annotate(
|
|
|
|
|
|
|
|
end_at=ExpressionWrapper(
|
|
|
|
|
|
|
|
F("start_at") + F("duration"),
|
|
|
|
|
|
|
|
output_field=DateTimeField(),
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
)
|
|
|
|
.filter(
|
|
|
|
.filter(
|
|
|
|
help_wanted,
|
|
|
|
help_wanted,
|
|
|
|
start_at__gt=timezone.now(),
|
|
|
|
end_at__gte=timezone.now(),
|
|
|
|
deleted=False,
|
|
|
|
deleted=False,
|
|
|
|
)
|
|
|
|
)
|
|
|
|
.order_by("start_at", "room_id")
|
|
|
|
.order_by("start_at", "room_id")
|
|
|
@ -48,9 +55,15 @@ def terminal(request):
|
|
|
|
)
|
|
|
|
)
|
|
|
|
shifts = (
|
|
|
|
shifts = (
|
|
|
|
Shift.with_reg_count()
|
|
|
|
Shift.with_reg_count()
|
|
|
|
|
|
|
|
.annotate(
|
|
|
|
|
|
|
|
end_at=ExpressionWrapper(
|
|
|
|
|
|
|
|
F("start_at") + F("duration"),
|
|
|
|
|
|
|
|
output_field=DateTimeField(),
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
)
|
|
|
|
.filter(
|
|
|
|
.filter(
|
|
|
|
help_wanted,
|
|
|
|
help_wanted,
|
|
|
|
start_at__gt=timezone.now() - timedelta(minutes=20),
|
|
|
|
end_at__gte=timezone.now(),
|
|
|
|
deleted=False,
|
|
|
|
deleted=False,
|
|
|
|
)
|
|
|
|
)
|
|
|
|
.order_by("start_at", "room_id")
|
|
|
|
.order_by("start_at", "room_id")
|
|
|
|