Loefbijter / loefsys

MIT License
0 stars 1 forks source link

Change enum fields from CharFields to IntegerFields #17

Open JortRoelofs opened 3 months ago

JortRoelofs commented 3 months ago

This might fall under the category of premature optimization, but I believe that enum fields should be changed from CharFields to IntegerFields. An example of this is the Membership_type on the Membership model. I'm not sure if it actually is noticable, but AFAIK a string comparison is many times more computationally expensive than an integer comparison. Additionally, Django's implementation of IntegerChoices does not have any drawbacks in terms of readability. The only difference is in how the backend SQL server handles these fields. Therefore, I think we should consider changing these fields.

JortRoelofs commented 1 month ago

@mark-boute can you take care of this for fields with choices in the users app?