summaryrefslogtreecommitdiff
path: root/docs/topics/forms
diff options
context:
space:
mode:
authorNick Pope <nick@nickpope.me.uk>2023-08-31 02:57:40 +0100
committerGitHub <noreply@github.com>2023-08-30 22:57:40 -0300
commit500e01073adda32d5149624ee9a5cb7aa3d3583f (patch)
treef9416872a811aa39646deaf002414e0a7841b6d1 /docs/topics/forms
parent68a8996bdfce2d191decd7b1c1a2b9fdea8e4b2f (diff)
Fixed #31262 -- Added support for mappings on model fields and ChoiceField's choices.
Diffstat (limited to 'docs/topics/forms')
-rw-r--r--docs/topics/forms/modelforms.txt10
1 files changed, 5 insertions, 5 deletions
diff --git a/docs/topics/forms/modelforms.txt b/docs/topics/forms/modelforms.txt
index 7f3c042f30..fbd5695c17 100644
--- a/docs/topics/forms/modelforms.txt
+++ b/docs/topics/forms/modelforms.txt
@@ -173,11 +173,11 @@ Consider this set of models::
from django.db import models
from django.forms import ModelForm
- TITLE_CHOICES = [
- ("MR", "Mr."),
- ("MRS", "Mrs."),
- ("MS", "Ms."),
- ]
+ TITLE_CHOICES = {
+ "MR": "Mr.",
+ "MRS": "Mrs.",
+ "MS": "Ms.",
+ }
class Author(models.Model):