Hello,

I found a curious problem in my application when I put it into
production this week: when a models.FloatField is "extracted" from the
database, its type changes depending on the database.  With SQLite in
development, I got back floats, while on MySQL in production I have
decimals.  As mentionned in other posts, decimals are not serializable
in JSON.

We are using Django 0.96 (and have no intention to use the Subversion
branch.)  Is it possible to fix the problem without applying a patch?
I don't have root access to the production environment, so I can't
apply patches.

Vincent.


>>> # Development environment w/ SQLite
>>> from gestio.inventory.models import *
>>> import django
>>> type(Item.objects.all()[0].loss)
<type 'float'>
>>> django.VERSION
(0, 96, None)
>>>

>>> # Production environment w/ PostgreSQL
>>> from gestio.inventory.models import *
>>> import django
>>> type(Item.objects.all()[0].loss)
<class 'decimal.Decimal'>
>>> django.VERSION
(0, 96, None)
>>>


--~--~---------~--~----~------------~-------~--~----~
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