Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recreate cleaning schedule #34

Open
rhetenor opened this issue Jul 4, 2020 · 4 comments
Open

Recreate cleaning schedule #34

rhetenor opened this issue Jul 4, 2020 · 4 comments
Assignees

Comments

@rhetenor
Copy link

rhetenor commented Jul 4, 2020

Hey,

Just finished setting everything up and looks very good. But when setting up the cleaning schedule I've re-decided - after already generating the schedule - to change the existing schedules from 5 to 4 (since I do not want to have schedules occurying twice with 4 members). But now I do not see any possibility to either reschedule everything (since formally the existing ones are correct) or at least it would be nice to have an option to delete all existing schedules.

Thank you

@monoclecat monoclecat self-assigned this Jul 5, 2020
@monoclecat
Copy link
Owner

Please help me understand your circumstances

But when setting up the cleaning schedule I've re-decided to change the existing schedules from 5 to 4.

Do you mean you deleted one of the 5 schedules?

@rhetenor
Copy link
Author

rhetenor commented Jul 5, 2020

My situation is as following 4 people and 5 schedules. This led to the situation that the people were assigned to a single schedule as following: 1, 2, 3, 4, 4. Thats not an issue at all its as far as is can tell a totally meaningful order. But it was not my intention since i wanted something more like: 1, 2, 3, 4, 1, 2, 3, 4.
So I thought since 2 of the 5 schedules are in my case quite similar I'll just delete one and merge it to the other, so with recreating the schedules it should create me this order. But unfortunately I see no possibility to delete the existing schedules and start from scratch (without deleting the database or manually editing it what I'm kind of afraid of to mess around).
What worked for me is deleting all schedules and recreating them but it felt like unnecessary work since I just wanted to get them rescheduled.

@monoclecat
Copy link
Owner

The order in which Cleaners are assigned to a Schedule has a random element in it, which means that it won't be a nice "1, 2, 3, 4, 1, 2, 3, 4"-ordering. Overall, in the long term, all Cleaners will have an equal number of Assignments for a Schedule.

But unfortunately I see no possibility to delete the existing schedules and start from scratch

For a running system I want to restrict the abilities of the Admin, so that the Assignments for a Cleaner don't change when they don't need to be changed. This is why I haven't implemented the ability of recreating valid Assignments yet. I want a Cleaner to be able to trust in the stability of the Assignments to some degree.

There are two possibilities for what you would like to achieve:

1. In CleanSys iself, without needing a terminal. This can only affect Assignments in the future.

If you would like to reschedule all future Assignments of a Schedule, you can recreate (delete, then add) the Affiliation (Zugehörigkeit) of a Cleaner who is part of a Schedule. This will set all Assignments in the given timeframe, of all Schedules he/she is a part of, to invalid.

2. Using a Terminal. Will delete all Assignments of a Schedule.

Open the django shell in the terminal with python manage.py shell. Make sure you are in the correct directory when running this.

Take note of the Schedule's slug. Example: Schedule name: "Obere Küche" -> Schedule's slug "obere-kuche"

Run these commands, one after the other, and make sure the variables have the correct content. I wrote these commands down from memory.

from webinterface.models import *
schedule = Schedule.objects.get(slug="schedule-slug")
print(schedule)
assignments = schedule.assignment_set
print(assignments)
assignments.delete()

The schedule should be free of Assignments now.

@rhetenor
Copy link
Author

rhetenor commented Jul 6, 2020

For a running system I want to restrict the abilities of the Admin, so that the Assignments for a Cleaner don't change when they don't need to be changed. This is why I haven't implemented the ability of recreating valid Assignments yet. I want a Cleaner to be able to trust in the stability of the Assignments to some degree.

Okay I see your point. In my opinion with great power comes great responsibility and an admin should think before he does something and therefore should be able to do whatever she wants to do. But now that you've pointed out how to do this with a bit more effort I'm totally fine with this. It's definitely not a common problem and should only occur in initial configuration when you want to partially reset. So a bit more effort for this is fine :bow

This may be another issue but I do not quite get whats the reason behind the random component in assignments when
#tasks <= #persons. In this situation it should be the best way to go to distribute them equally because for 1 task and 3 persons in 9 weeks this could lead to the assignment situation 1 1 1 2 2 2 3 3 3. It might be an equal number of assignments but is hard to convince the other cleaners to accept this schedule from the beginning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants