瀏覽代碼

Refs #30947 -- Changed tuples to lists in model Meta options examples in docs.

Follow up to 97d3321e89c8d4434927bdbc308db1ccffa99d3b.
Mariusz Felisiak 5 年之前
父節點
當前提交
e5cacb1f47
共有 2 個文件被更改,包括 3 次插入3 次删除
  1. 2 2
      docs/topics/db/examples/many_to_many.txt
  2. 1 1
      docs/topics/db/examples/many_to_one.txt

+ 2 - 2
docs/topics/db/examples/many_to_many.txt

@@ -18,7 +18,7 @@ objects, and a ``Publication`` has multiple ``Article`` objects:
         title = models.CharField(max_length=30)
 
         class Meta:
-            ordering = ('title',)
+            ordering = ['title']
 
         def __str__(self):
             return self.title
@@ -28,7 +28,7 @@ objects, and a ``Publication`` has multiple ``Article`` objects:
         publications = models.ManyToManyField(Publication)
 
         class Meta:
-            ordering = ('headline',)
+            ordering = ['headline']
 
         def __str__(self):
             return self.headline

+ 1 - 1
docs/topics/db/examples/many_to_one.txt

@@ -23,7 +23,7 @@ To define a many-to-one relationship, use :class:`~django.db.models.ForeignKey`:
             return self.headline
 
         class Meta:
-            ordering = ('headline',)
+            ordering = ['headline']
 
 What follows are examples of operations that can be performed using the Python
 API facilities.