-
-
Save cicorias/36f83b8caa18ffe0436eb5334f1752dc to your computer and use it in GitHub Desktop.
using choice fields
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.db import models | |
class BakedGood(models.Model): | |
name = models.CharField(max_length=64) | |
desc = models.CharField(max_length=256) | |
good_type = models.TextChoices('type', 'BAGEL BREAD COOKIE CAKE PRETZEL') | |
sTypes = models.CharField(blank=True, choices=good_type.choices, max_length=20) | |
price = models.DecimalField(max_digits=6, decimal_places=2) | |
recipe = models.TextField() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment