otis-web
otis-web copied to clipboard
Decouple Difficulty and Version Fields
Fixes #317.
Implements version codes as
DIFFICULTY_CHOICES = (
("B", "Easy/Bet"),
("D", "Medium/Dalet"),
("Z", "Hard/Zayin"),
)
VERSION_CHOICES = (
("V", "V (Secret)"),
("W", "W"),
("X", "X"),
("Y", "Y"),
)
difficulty = models.CharField(
max_length=2,
choices=DIFFICULTY_CHOICES,
help_text="The difficulty code for the handout, like B",
)
version = models.CharField(
max_length=2,
choices=VERSION_CHOICES,
help_text="The version code for the handout, like W",
)
Benefits of this include being less prone to typos and less redundant information stored as the group subject.
Other things this implies
- Migrate the database. Probably make a backup before that? See the custom code in the migration.
- There's likely some latent bugs here. Will fix as notified. Free 500 diamond I suppose.
- venueQ needs to be updated for this
- fixtures should be re-dumped to conform to this format. Maybe deprecate all.json, though not sure anymore.
although this is probably the way the code should have been written, i'm a bit hesitant to merge this at a time of year where i expect to be pretty busy. this is a pretty big migration, a lot of code changes (i feel like i'd need to test this a lot before i feel like it's safe to merge) and it would require venueQ to be updated as well
so i'll leave this open for now, but it'll be a while before i get to actually processing it
okay i've thought about this more and i've decided that fixing this is probably not worth it, due to all the changes that would be needed in many places (in particular, i'm sure we won't catch everything, even with the unit tests). "there's likely some latent bugs here" is a worse outcome to me than a small amount of extra redundancy in the database.
Yeah that makes sense I suppose.