#34527: Unexpected behavior with division in aggregation
-------------------------------------+-------------------------------------
     Reporter:  Egor R               |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:  Database layer       |                  Version:  3.2
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:
                                     |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by David Sanders):

 Hi,

 Casting is required here, `output_field` just lets Django know what type
 the returned data is:

 > The output_field argument requires a model field instance, like
 IntegerField() or BooleanField(), into which Django will load the value
 after it’s retrieved from the database.

 Ref: https://docs.djangoproject.com/en/4.2/ref/models/expressions
 /#aggregate-expressions

-- 
Ticket URL: <https://code.djangoproject.com/ticket/34527#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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070187cdfd030b-edfe8fa2-672d-47dc-976f-5a23f73ff5f1-000000%40eu-central-1.amazonses.com.

Reply via email to