On Tue, 2007-05-08 at 17:44 -0400, Andy Dustman wrote:
> On 5/2/07, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote:
> 
> > I'm going to work on that problem (putting in decimal support) this week
> > sometime. Maybe today or tomorrow. It's starting to annoy me, seeing all
> > the decimal-reated tickets in Trac, so after I knock off all the email
> > ones (today), I want to fix up the decimal problem, in between other
> > things.
> 
> Just to be clear MySQL has separate FLOAT and DECIMAL/NUMERIC column
> types; the latter are fixed-point fields which correspond to Python's
> Decimal type. So it is unfortunate that the Django mysql backend is
> using a NUMERIC column for FloatField. Perhaps Django needs a
> DecimalField (or NumericField) for fixed-point values? (You might be
> working on this; haven't searched bugs.)
> 
> There's also a DOUBLE column type in MySQL for double-precision, which
> may be a better fit for Python's float (which is a C double) and
> Django's FloatField. MySQLdb returns FLOAT and DOUBLE columns as
> Python floats so it's a matter of how much storage/precision you want.
> 
> http://dev.mysql.com/doc/refman/5.0/en/numeric-type-overview.html

Thanks Andy. I understand the column types. MySQL is SQL-standard in
that respect. The idea is to move current FloatField to DecimalField,
which has the current fixed point underlying database representation and
returns Python decimals (emulated in 2.3) and add a FloatField that
returns Python floats and uses NUMERIC on the database side. Ticket
#2365 has a patch that does most of the work; I'm just tidying it up a
bit and doing a lot of testing and thinking.

Accidentally nuked my Python 2.3 sub-directory over the weekend in a fit
of tidying up, so I had to rebuild all the support libraries (MySQLdb,
psycopg*, etc) yesterday, which was sort of the opposite of fun. But
back on track now.

Regards,
Malcolm


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to