Skip to content
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

Database validation for model field choices #2185

Open
richardebeling opened this issue May 13, 2024 · 0 comments
Open

Database validation for model field choices #2185

richardebeling opened this issue May 13, 2024 · 0 comments
Labels
[C] Backend Focuses on backend implementation [S] Small This issue should require only small changes.

Comments

@richardebeling
Copy link
Member

See discussion in #1776. Django doesn't actually validate on the database level that only choice values are stored. This lead to us not noticing an outdated test data dump in #1776.

Optimally, we'd like to have database constraints for all model fields with choices, and we would like to not repeat the choices. See the discussion at #1776 for a suggested approach using a decorator that seems reasonable to me at first glance.

@richardebeling richardebeling added [C] Backend Focuses on backend implementation [S] Small This issue should require only small changes. labels May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[C] Backend Focuses on backend implementation [S] Small This issue should require only small changes.
Development

No branches or pull requests

1 participant