mirror of
https://github.com/django/django.git
synced 2025-11-01 12:25:37 +00:00
Fixed #28335 -- Allowed query expressions in Meta.ordering.
This commit is contained in:
parent
3d2c3905a6
commit
093fd479d6
5 changed files with 37 additions and 6 deletions
|
|
@ -42,6 +42,12 @@ class OrderedByAuthorArticle(Article):
|
|||
ordering = ('author', 'second_author')
|
||||
|
||||
|
||||
class OrderedByFArticle(Article):
|
||||
class Meta:
|
||||
proxy = True
|
||||
ordering = (models.F('author').asc(nulls_first=True), 'id')
|
||||
|
||||
|
||||
class Reference(models.Model):
|
||||
article = models.ForeignKey(OrderedByAuthorArticle, models.CASCADE)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue