Re: [Django] #33790: Add more database functions/aggregates. (was: ORM functions suggestion)

4 views
Skip to first unread message

Django

unread,
Jun 17, 2022, 6:29:04 AM6/17/22
to django-...@googlegroups.com
#33790: Add more database functions/aggregates.
-------------------------------------+-------------------------------------
Reporter: zarinpy | Owner: nobody
Type: New feature | Status: closed
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution: wontfix
Keywords: orm | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* status: new => closed
* resolution: => wontfix


Comment:

Most of functions/aggregates mentioned in the ticket description are
included in Django:
- `bit_xor()` -> `django.contrib.postgres.aggregates.BitXor`,
- `bool_and()` -> `django.contrib.postgres.aggregates.BoolAnd`,
- `covar_samp()` -> `django.contrib.postgres.aggregates.CovarPop` (with
`sample=True`),
- `stddev_pop()` -> `django.db.models.StdDev`.

As far as I'm aware after implementing #28643 we don't want to add more
functions to the core unless they are common and supported by all
backends. The current thread is to keep Django a core framework, not
providing every utility which might be useful. You can write your own
function, e.g.
{{{#!python
class Cbrt(Transform):
function = "CBRT"
lookup_name = "cbrt"
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/33790#comment:3>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Reply all
Reply to author
Forward
0 new messages