1
0
mirror of https://github.com/django/django.git synced 2025-11-07 07:15:35 +00:00

Fixed #27719 -- Added QuerySet.alias() to allow creating reusable aliases.

QuerySet.alias() allows creating reusable aliases for expressions that
don't need to be selected but are used for filtering, ordering, or as
a part of complex expressions.

Thanks Simon Charette for reviews.
This commit is contained in:
Alexandr Tatarinov
2020-06-14 21:38:43 +03:00
committed by Mariusz Felisiak
parent 88af11c58b
commit f4ac167119
8 changed files with 294 additions and 6 deletions

View File

@@ -269,6 +269,10 @@ Models
:py:class:`datetime.time`, :py:class:`datetime.timedelta`,
:py:class:`decimal.Decimal`, and :py:class:`uuid.UUID` instances.
* The new :meth:`.QuerySet.alias` method allows creating reusable aliases for
expressions that don't need to be selected but are used for filtering,
ordering, or as a part of complex expressions.
Requests and Responses
~~~~~~~~~~~~~~~~~~~~~~