-
Notifications
You must be signed in to change notification settings - Fork 67
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
Decouple Difficulty and Version Fields #321
Conversation
@@ -19,7 +19,8 @@ | |||
<li>The second letter repeats the olympiad category.</li> | |||
<li> | |||
The third letter is a version identifier (either W, X, or Y). | |||
Many topics have multiple versions so they can be repeated in different years. | |||
Many topics have multiple versions so they can be repeated in different years, | |||
but you can do the same topic multiple times in one year as well. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added this comment since I misinterpreted it the first time.
@@ -115,7 +115,7 @@ def test_level_up(self): | |||
alice = self.get_alice() | |||
self.login(alice) | |||
bonus = BonusLevelFactory.create(group__name="Level 40 Quest", level=40) | |||
bonus_unit = UnitFactory.create(group=bonus.group, code="DKU") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cursed U version code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WHAT IS THIS
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's "Level 40 Quest"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It refers to a secret unit level.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i prefer meow :3
|
||
|
||
def set_difficulty_and_version(apps, schema_editor): | ||
# We can't import the Person model directly as it may be a newer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems to be a copy paste error?
), | ||
preserve_default=False, | ||
), | ||
migrations.RunPython(set_difficulty_and_version), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doesn't RunPython need a reverse operation argument or something like that? at least i feel like i've had to specified noop a bunch before in the past
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that its optional? Stackoverflow had that at some point and it seems to migrate properly.
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. |
Fixes #317.
Implements version codes as
Benefits of this include being less prone to typos and less redundant information stored as the group subject.
Other things this implies