e-valuation / EvaP

a university course evaluation system written in Python using Django
Other
95 stars 146 forks source link

Make Evaluation.State an IntEnum #2174

Closed fekoch closed 1 month ago

fekoch commented 2 months ago

Originally a part of PR #2136. Like @niklasmohrin suggested, I pulled the specific changes required to make Evaluation.State an enum.

In the process I discovered Django's own models.IntegerChoices, which works even better than the python IntEnum. It also generates a migration that does not depend on the Evaluation class (also an issue @niklasmohrin mentioned)