diff --git a/django/contrib/admin/migrations/0001_initial.py b/django/contrib/admin/migrations/0001_initial.py index f1e2804ce4..78cd7a7112 100644 --- a/django/contrib/admin/migrations/0001_initial.py +++ b/django/contrib/admin/migrations/0001_initial.py @@ -34,7 +34,7 @@ class Migration(migrations.Migration): )), ], options={ - 'ordering': ('-action_time',), + 'ordering': ['-action_time'], 'db_table': 'django_admin_log', 'verbose_name': 'log entry', 'verbose_name_plural': 'log entries', diff --git a/django/contrib/admin/models.py b/django/contrib/admin/models.py index 0b2b779d7a..a0fbb02afd 100644 --- a/django/contrib/admin/models.py +++ b/django/contrib/admin/models.py @@ -66,7 +66,7 @@ class LogEntry(models.Model): verbose_name = _('log entry') verbose_name_plural = _('log entries') db_table = 'django_admin_log' - ordering = ('-action_time',) + ordering = ['-action_time'] def __repr__(self): return str(self.action_time) diff --git a/django/contrib/auth/migrations/0001_initial.py b/django/contrib/auth/migrations/0001_initial.py index c1fbe9a613..4fb11d0bbe 100644 --- a/django/contrib/auth/migrations/0001_initial.py +++ b/django/contrib/auth/migrations/0001_initial.py @@ -25,7 +25,7 @@ class Migration(migrations.Migration): ('codename', models.CharField(max_length=100, verbose_name='codename')), ], options={ - 'ordering': ('content_type__app_label', 'content_type__model', 'codename'), + 'ordering': ['content_type__app_label', 'content_type__model', 'codename'], 'unique_together': {('content_type', 'codename')}, 'verbose_name': 'permission', 'verbose_name_plural': 'permissions', diff --git a/django/contrib/auth/models.py b/django/contrib/auth/models.py index 27278af4d2..ce93ee062b 100644 --- a/django/contrib/auth/models.py +++ b/django/contrib/auth/models.py @@ -66,9 +66,8 @@ class Permission(models.Model): class Meta: verbose_name = _('permission') verbose_name_plural = _('permissions') - unique_together = (('content_type', 'codename'),) - ordering = ('content_type__app_label', 'content_type__model', - 'codename') + unique_together = [['content_type', 'codename']] + ordering = ['content_type__app_label', 'content_type__model', 'codename'] def __str__(self): return '%s | %s' % (self.content_type, self.name) diff --git a/django/contrib/contenttypes/models.py b/django/contrib/contenttypes/models.py index 597a8faa32..704d79826d 100644 --- a/django/contrib/contenttypes/models.py +++ b/django/contrib/contenttypes/models.py @@ -139,7 +139,7 @@ class ContentType(models.Model): verbose_name = _('content type') verbose_name_plural = _('content types') db_table = 'django_content_type' - unique_together = (('app_label', 'model'),) + unique_together = [['app_label', 'model']] def __str__(self): return self.app_labeled_name diff --git a/django/contrib/flatpages/migrations/0001_initial.py b/django/contrib/flatpages/migrations/0001_initial.py index 6bb1bfb6ef..867cd6d4ea 100644 --- a/django/contrib/flatpages/migrations/0001_initial.py +++ b/django/contrib/flatpages/migrations/0001_initial.py @@ -29,7 +29,7 @@ class Migration(migrations.Migration): ('sites', models.ManyToManyField(to='sites.Site', verbose_name='sites')), ], options={ - 'ordering': ('url',), + 'ordering': ['url'], 'db_table': 'django_flatpage', 'verbose_name': 'flat page', 'verbose_name_plural': 'flat pages', diff --git a/django/contrib/flatpages/models.py b/django/contrib/flatpages/models.py index de726b7b89..f2d66b1c69 100644 --- a/django/contrib/flatpages/models.py +++ b/django/contrib/flatpages/models.py @@ -30,7 +30,7 @@ class FlatPage(models.Model): db_table = 'django_flatpage' verbose_name = _('flat page') verbose_name_plural = _('flat pages') - ordering = ('url',) + ordering = ['url'] def __str__(self): return "%s -- %s" % (self.url, self.title) diff --git a/django/contrib/redirects/migrations/0001_initial.py b/django/contrib/redirects/migrations/0001_initial.py index b3fa17cfa0..baacd1ceaa 100644 --- a/django/contrib/redirects/migrations/0001_initial.py +++ b/django/contrib/redirects/migrations/0001_initial.py @@ -29,7 +29,7 @@ class Migration(migrations.Migration): )), ], options={ - 'ordering': ('old_path',), + 'ordering': ['old_path'], 'unique_together': {('site', 'old_path')}, 'db_table': 'django_redirect', 'verbose_name': 'redirect', diff --git a/django/contrib/redirects/models.py b/django/contrib/redirects/models.py index 100c90fc88..a9f17be5eb 100644 --- a/django/contrib/redirects/models.py +++ b/django/contrib/redirects/models.py @@ -22,8 +22,8 @@ class Redirect(models.Model): verbose_name = _('redirect') verbose_name_plural = _('redirects') db_table = 'django_redirect' - unique_together = (('site', 'old_path'),) - ordering = ('old_path',) + unique_together = [['site', 'old_path']] + ordering = ['old_path'] def __str__(self): return "%s ---> %s" % (self.old_path, self.new_path) diff --git a/django/contrib/sites/migrations/0001_initial.py b/django/contrib/sites/migrations/0001_initial.py index a7639869fc..9b261900fa 100644 --- a/django/contrib/sites/migrations/0001_initial.py +++ b/django/contrib/sites/migrations/0001_initial.py @@ -18,7 +18,7 @@ class Migration(migrations.Migration): ('name', models.CharField(max_length=50, verbose_name='display name')), ], options={ - 'ordering': ('domain',), + 'ordering': ['domain'], 'db_table': 'django_site', 'verbose_name': 'site', 'verbose_name_plural': 'sites', diff --git a/django/contrib/sites/models.py b/django/contrib/sites/models.py index c8c05a8cf9..3dc4c254d7 100644 --- a/django/contrib/sites/models.py +++ b/django/contrib/sites/models.py @@ -91,7 +91,7 @@ class Site(models.Model): db_table = 'django_site' verbose_name = _('site') verbose_name_plural = _('sites') - ordering = ('domain',) + ordering = ['domain'] def __str__(self): return self.domain diff --git a/docs/releases/3.1.txt b/docs/releases/3.1.txt index e8cb289873..1a965b41b5 100644 --- a/docs/releases/3.1.txt +++ b/docs/releases/3.1.txt @@ -282,6 +282,11 @@ Miscellaneous * :tfilter:`floatformat` template filter now outputs (positive) ``0`` for negative numbers which round to zero. +* :attr:`Meta.ordering ` and + :attr:`Meta.unique_together ` + options on models in ``django.contrib`` modules that were formerly tuples are + now lists. + .. _deprecated-features-3.1: Features deprecated in 3.1