I want to change the atribute
NGOQuotasForm class in
un/modules/registration/forms.py to accept 3 values: Allowed, Inherited and Not Allowed.
At present, that attribute accepts a boolean and uses a switch widget to select between values.
I want to solve this, but I have two approaches and I’m not sure about how to proceed:
First approach: Change that column in the database to accept nulls and consider the null value as the inherited. That approach needs to adapt
indico.web.forms.widgets.SwitchWidgetto accept 3 values.
Second approach: Use an enum. This approach can appear simpler, but It has lot of problems on the backend, because the column accepts boolean values and boolean can’t be casted to enum in a migration, so I would need to create a new column, copy the values as enum, and overwrite the previous column.
What would you do and why? Do you think a 3-values-boolean is contraintuitive or that the process to create that new column can create inconsistencies in the database?