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

Implement choices as Literal for PyDantic #1033

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Commits on Jan 2, 2024

  1. feat: Add choice field support

    - If the field has choices, create a Literal from the choices
    
    chore:
    - Temporarily disable mypy, because of the limited scope of pre-commit,
      mypy flags the changed function as untyped and this can't be ignored
      or suppressed
    msopacua committed Jan 2, 2024
    Configuration menu
    Copy the full SHA
    0721da2 View commit details
    Browse the repository at this point in the history
  2. Add choices exclude functionality

    For possibly large fields (like all timezones) add the ability to
    exclude some of the choice fields.
    msopacua committed Jan 2, 2024
    Configuration menu
    Copy the full SHA
    a5f4e6b View commit details
    Browse the repository at this point in the history
  3. Restore mypy in pre-commit

    msopacua committed Jan 2, 2024
    Configuration menu
    Copy the full SHA
    73522ed View commit details
    Browse the repository at this point in the history
  4. Fix from_orm():

    If we set the types to Literal, PyDantic must receive the literal
    values, not the Enum instances.
    msopacua committed Jan 2, 2024
    Configuration menu
    Copy the full SHA
    70b8e7d View commit details
    Browse the repository at this point in the history