diff options
| author | ruchit2801 <vithaniruchit@gmail.com> | 2019-05-17 13:00:57 +0530 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2019-05-18 19:29:00 +0200 |
| commit | 04042b2b440f0bf50eb908d52cfe76af430e1738 (patch) | |
| tree | 65dcb4110c7da75f8589b8c3f714a5e859335e6d /tests/ordering/models.py | |
| parent | e86cc14bd36734d81c4e490a2453778e33b95a45 (diff) | |
Fixed #30463 -- Fixed crash of deprecation message when Meta.ordering contains expressions.
Regression in 1b1f64ee5a78cc217fead52cbae23114502cf564.
Diffstat (limited to 'tests/ordering/models.py')
| -rw-r--r-- | tests/ordering/models.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/ordering/models.py b/tests/ordering/models.py index 85e8c59bb6..8b71983c44 100644 --- a/tests/ordering/models.py +++ b/tests/ordering/models.py @@ -14,6 +14,7 @@ undefined -- not random, just undefined. """ from django.db import models +from django.db.models.expressions import OrderBy class Author(models.Model): @@ -30,7 +31,12 @@ class Article(models.Model): pub_date = models.DateTimeField() class Meta: - ordering = ('-pub_date', 'headline') + ordering = ( + '-pub_date', + 'headline', + models.F('author__name').asc(), + OrderBy(models.F('second_author__name')), + ) def __str__(self): return self.headline |
