#32585: Type Error when annotating a decimal to decimal field with SQLite3
-------------------------------------+-------------------------------------
               Reporter:  Adrian     |          Owner:  nobody
                   Type:  Bug        |         Status:  new
              Component:  Database   |        Version:  3.1
  layer (models, ORM)                |       Keywords:  SQLite3, annotate,
               Severity:  Normal     |  decimal
           Triage Stage:             |      Has patch:  0
  Unreviewed                         |
    Needs documentation:  0          |    Needs tests:  0
Patch needs improvement:  0          |  Easy pickings:  1
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
 If you try to annotate anything to a decimal field Django will pass a
 string to create_decimal_from_float function.

 
[https://github.com/django/django/blob/021f946569d0714fccd090bb2a5f1d7ab2720447/django/db/backends/sqlite3/operations.py#L304-L318
 These are the offending lines]

 example code:

 {{{
 SomeModel.objects.all().annotate(shear_length=Value(1,
 output_field=DecimalField()))
 }}}

-- 
Ticket URL: <https://code.djangoproject.com/ticket/32585>
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/065.6d1eb3a64fb5e8288a3921e1a2cf24a8%40djangoproject.com.

Reply via email to