#11294: Django administration Model list always shows Decimal with decimal 
places
-------------------------------+------------------------------------
     Reporter:  jason@…        |                    Owner:  gaweng
         Type:  Bug            |                   Status:  assigned
    Component:  contrib.admin  |                  Version:  dev
     Severity:  Normal         |               Resolution:
     Keywords:                 |             Triage Stage:  Accepted
    Has patch:  0              |      Needs documentation:  0
  Needs tests:  0              |  Patch needs improvement:  0
Easy pickings:  0              |                    UI/UX:  0
-------------------------------+------------------------------------
Changes (by gaweng):

 * cc: gaweng (added)

Comment:

 Issue doesn't exist anymore, cause its handled already in DB Connectors:

 SQLite:

 {{{
 # operations.py Line 316-328
 def get_decimalfield_converter(self, expression):
     if isinstance(expression, Col):
         quantize_value = decimal.Decimal(1).scaleb(
             -expression.output_field.decimal_places
         )
         def converter(value, expression, connection):
             if value is not None:
                 return self._create_decimal(value).quantize(
                     quantize_value,
 context=expression.output_field.context
                 )
 }}}


 PostgreSQL:

 {{{
 # base.py Line 93-96
 def _get_decimal_column(data):
     if data["max_digits"] is None and data["decimal_places"] is None:
         return "numeric"
     return "numeric(%(max_digits)s, %(decimal_places)s)" % data
 }}}


 MariabDB:

 {{{
 # operations.py Line 28
 "DecimalField": "decimal(%(max_digits)s, %(decimal_places)s)",
 }}}
-- 
Ticket URL: <https://code.djangoproject.com/ticket/11294#comment:9>
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 visit 
https://groups.google.com/d/msgid/django-updates/0107019e6875deb5-6daa5806-038c-43e4-8c0d-f95689d1f4e1-000000%40eu-central-1.amazonses.com.

Reply via email to