#10929: Support a default value for Sum (and possibly other aggregation
functions)
-------------------------------------+-------------------------------------
Reporter: nolan | Owner:
Type: New feature | Status: new
Component: ORM aggregation | Version: SVN
Severity: Normal | Resolution:
Keywords: aggregate annotate | Triage Stage: Accepted
default | Needs documentation: 1
Has patch: 1 | Patch needs improvement: 0
Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Changes (by mrmachine):
* cc: real.human@… (added)
* version: 1.1-beta-1 => SVN
* keywords: => aggregate annotate default
* needs_docs: 0 => 1
* has_patch: 0 => 1
* ui_ux: => 0
Comment:
Just added a patch with an initial implementation for this feature. It
should work for all aggregates by wrapping the default `sql_template` in
`COALESCE(%s, %%(default)s)`, if `params` has a `default` item. There's a
basic test in there that checks the behaviour for `Avg` with and without a
default. If there's positive feedback about the implementation, I'll have
a go at adding documentation and any improvements to the implementation
and tests that are suggested.
--
Ticket URL: <https://code.djangoproject.com/ticket/10929#comment:4>
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en.