From 97d3321e89c8d4434927bdbc308db1ccffa99d3b Mon Sep 17 00:00:00 2001 From: Jon Dufresne Date: Wed, 15 May 2019 05:31:42 -0700 Subject: Changed tuple choices to list in docs. --- docs/topics/db/managers.txt | 4 ++-- docs/topics/db/models.txt | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'docs/topics/db') diff --git a/docs/topics/db/managers.txt b/docs/topics/db/managers.txt index 6c9e6a4163..a08dddd028 100644 --- a/docs/topics/db/managers.txt +++ b/docs/topics/db/managers.txt @@ -161,7 +161,7 @@ For example:: class Person(models.Model): first_name = models.CharField(max_length=50) last_name = models.CharField(max_length=50) - role = models.CharField(max_length=1, choices=(('A', _('Author')), ('E', _('Editor')))) + role = models.CharField(max_length=1, choices=[('A', _('Author')), ('E', _('Editor'))]) people = models.Manager() authors = AuthorManager() editors = EditorManager() @@ -261,7 +261,7 @@ custom ``QuerySet`` if you also implement them on the ``Manager``:: class Person(models.Model): first_name = models.CharField(max_length=50) last_name = models.CharField(max_length=50) - role = models.CharField(max_length=1, choices=(('A', _('Author')), ('E', _('Editor')))) + role = models.CharField(max_length=1, choices=[('A', _('Author')), ('E', _('Editor'))]) people = PersonManager() This example allows you to call both ``authors()`` and ``editors()`` directly from diff --git a/docs/topics/db/models.txt b/docs/topics/db/models.txt index f895db89fa..6964876a3e 100644 --- a/docs/topics/db/models.txt +++ b/docs/topics/db/models.txt @@ -161,13 +161,13 @@ ones: A choices list looks like this:: - YEAR_IN_SCHOOL_CHOICES = ( + YEAR_IN_SCHOOL_CHOICES = [ ('FR', 'Freshman'), ('SO', 'Sophomore'), ('JR', 'Junior'), ('SR', 'Senior'), ('GR', 'Graduate'), - ) + ] The first element in each tuple is the value that will be stored in the database. The second element is displayed by the field's form widget. -- cgit v1.3