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

Use ENUM when you know the possible values to avoid typos... #1

Open
mendesbarreto opened this issue Jul 14, 2021 · 1 comment
Open

Comments

@mendesbarreto
Copy link

It's not good to let the front-end send anything, later to make/generate the reports is a big headache, because the data could not follow a pattern, and (plus) it will help to make some validations in the code when you receive the payload.

gender: str = 'Not Specified',

gender: Gender  = Gender.NEUTER

from enum import Enum
class Gender(Enum):
     MASCULINE = 1
     FEMININE = 2
     NEUTER = 3
@hitallow
Copy link
Owner

Thanks, fixed on 8cde8ed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants