mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +00:00
Fixed #31262 -- Added support for mappings on model fields and ChoiceField's choices.
This commit is contained in:
@@ -47,11 +47,11 @@ news application with an ``Article`` model::
|
||||
|
||||
from django.db import models
|
||||
|
||||
STATUS_CHOICES = [
|
||||
("d", "Draft"),
|
||||
("p", "Published"),
|
||||
("w", "Withdrawn"),
|
||||
]
|
||||
STATUS_CHOICES = {
|
||||
"d": "Draft",
|
||||
"p": "Published",
|
||||
"w": "Withdrawn",
|
||||
}
|
||||
|
||||
|
||||
class Article(models.Model):
|
||||
|
||||
Reference in New Issue
Block a user