#24767: Add GREATEST and LEAST Query Expressions
-------------------------------------+-------------------------------------
Reporter: Ian-Foote | Owner: nobody
Type: New feature | Status: new
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Ian-Foote):
For what it's worth, in my (current) use case the postgres handling of
`null` is ideal. I don't know how typical it is though.
My use case is annotating a model with a `last_updated` datetime. This is
calculated from the `created` datetime of two related models:
{{{
queryset.annotate(
last_update=Greatest(
Max('comments__created'),
Max('documents__created'),
),
)
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/24767#comment:2>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/067.c2882fe5e38ad6283644f8dbc98bf7e3%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.