Rework notes as episodes
This MR contains the changes required for #249.
It should be good-to-merge, but I’m keeping it as draft until I’ve finished a minimal dashboard implementation that may turn up some edge cases we haven’t thought of, as well as any missing episode endpoint filters that most certainly will be necessary to implement the assignment logic of episodes to timeslots.
I’ve added a few tests including a two migration tests that should ensure that we correctly migrate any data. Nonetheless we should test this migration on a production database copy before we merge.
I’ve also noted that the existing serializer and viewset implementations for models often contain permission and ownership logic that can and IMHO should be abstracted to more generic solutions in order to avoid repetition and the need to override base implementations (like Serializer.create) as well as improving error handling in general. I’ve implemented these changes for the timeslot and episode endpoints, which come in the form of custom viewset permission classes (here and here) as well as a serializer mixin for field write permissions.
Note: One of the migrations deletes all notes that have not been assigned to a timeslot. This shouldn’t be a problem as these notes are not accessible through the dashboard anyway. I reckon that I created these only locally and by accident.
Happy to hear any feedback.