Skip to content

Instantly share code, notes, and snippets.

@michaelhelmick
Last active April 2, 2021 20:32
Show Gist options
  • Save michaelhelmick/820707d57e7cc6b6e5ae861c37d5f8b6 to your computer and use it in GitHub Desktop.
Save michaelhelmick/820707d57e7cc6b6e5ae861c37d5f8b6 to your computer and use it in GitHub Desktop.
game/models.py with TeeBall
from django.utils.translation import gettext_lazy as _
class Game(models.Model):
TEEBALL_INTRODUCED_VERSION = "1.1.0"
class GameType(models.TextChoices):
BASEBALL = "BB", _("Baseball")
SOFTBALL = "SB", _("Softball")
TEEBALL = "TB", _("Tee-ball")
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