#26650: output_field key-word arg not respected in model query API
-------------------------------------+-------------------------------------
     Reporter:  freshquiz            |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:  Database layer       |                  Version:  master
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:  output_field         |             Triage Stage:
  expression query annotate          |  Unreviewed
  aggregate                          |
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by charettes):

 * needs_better_patch:   => 0
 * needs_tests:   => 0
 * needs_docs:   => 0


Comment:

 Did you try using the recently introduced `Cast()`
 [https://docs.djangoproject.com/en/dev/ref/models/database-functions/#cast
 expression]?

 {{{#!python
 TempModel.objects.aggregate(
     my_sum=Cast(Sum('field1'), DecimalField(max_digits=30,
 decimal_places=2)),
 )
 }}}

--
Ticket URL: <https://code.djangoproject.com/ticket/26650#comment:1>
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.d5e3875da52a2db9b33511691376c1a5%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to