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

TextChoicesFlag #103

Open
Confidenceman02 opened this issue May 20, 2024 · 0 comments
Open

TextChoicesFlag #103

Confidenceman02 opened this issue May 20, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@Confidenceman02
Copy link
Owner

Confidenceman02 commented May 20, 2024

Django model CharField's can have a text_choices set in the config to narrow an arbitrary string to a specific one.

Text choices are commonly sub classes like the following:

class Vehicle(models.TextChoices):
     CAR = "C"
     TRUCK = "T"
     JET_SKI = "J"

It would be handy to provide a Djelm analogue to this class and produce a CustomType:

type Vehicle
    = Car String
    | Truck String
    | Jet_ski String

Some discussion of this in #99

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

No branches or pull requests

1 participant