mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
Fixed #34388 -- Allowed using choice enumeration types directly on model and form fields.
This commit is contained in:
committed by
Mariusz Felisiak
parent
051d5944f8
commit
a2eaea8f22
@@ -211,7 +211,7 @@ ones:
|
||||
class Runner(models.Model):
|
||||
MedalType = models.TextChoices("MedalType", "GOLD SILVER BRONZE")
|
||||
name = models.CharField(max_length=60)
|
||||
medal = models.CharField(blank=True, choices=MedalType.choices, max_length=10)
|
||||
medal = models.CharField(blank=True, choices=MedalType, max_length=10)
|
||||
|
||||
Further examples are available in the :ref:`model field reference
|
||||
<field-choices>`.
|
||||
|
||||
Reference in New Issue
Block a user