Skip to content

Instantly share code, notes, and snippets.

@michaelhelmick
Created April 2, 2021 13:38
Show Gist options
  • Save michaelhelmick/a6a471c1e93597a3ae061df6277a6651 to your computer and use it in GitHub Desktop.
Save michaelhelmick/a6a471c1e93597a3ae061df6277a6651 to your computer and use it in GitHub Desktop.
game/models.py
from django.utils.translation import gettext_lazy as _
class Game(models.Model):
class GameType(models.TextChoices):
BASEBALL = "BB", _("Baseball")
SOFTBALL = "SB", _("Softball")
type = models.CharField(
max_length=2,
choices=GameType.choices,
default=GameType.BASEBALL,
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment