Add allow_self option to PostShiftConstraint and PreShiftConstraint for flexible shift assignment

This commit is contained in:
Ross
2025-12-08 17:47:19 +00:00
parent 3f4d8068eb
commit 4a8c478a73
3 changed files with 47 additions and 7 deletions
+1 -1
View File
@@ -350,7 +350,7 @@ def main(
assign_as_block=False,
constraints=[
PreShiftConstraint(days=2, start_date="2025-11-17", exclude_days=("Fri", "Sat", "Sun")),
PostShiftConstraint(days=1, start_date="2025-11-17", exclude_days=("Fri", "Sat", "Sun")),
PostShiftConstraint(days=1, start_date="2025-11-17", exclude_days=("Fri", "Sat", "Sun"), allow_self=True),
#{
# "name": "max_shifts_per_week",
# "options": 3,