Hello,

in my latest application I have models with like 15 Decimal fields,
with different decimal places.

when I try to save an object of that model, I get sometimes (often,
but not always) this error:

  File "/home/newt/django/1.0/sites/cdms/item/views.py", line 1054, in
item_copy
    object.save()

  File "/home/newt/django/1.0/lib/django/db/models/base.py", line 311,
in save

  File "/home/newt/django/1.0/lib/django/db/models/base.py", line 371,
in save_base

  File "/home/newt/django/1.0/lib/django/db/models/fields/
__init__.py", line 192, in get_db_prep_save

  File "/home/newt/django/1.0/lib/django/db/models/fields/
__init__.py", line 609, in get_db_prep_value

  File "/home/newt/django/1.0/lib/django/db/models/fields/
__init__.py", line 583, in to_python

  File "/usr/lib/python2.5/decimal.py", line 650, in __new__
    raise TypeError("Cannot convert %r to Decimal" % value)

TypeError: Cannot convert Decimal("0.0000") to Decimal

It fails on the first decimal field (at it's only one with 4 decimal
places) and it just happens sometimes.
I remember something like that used to happen with psycopg2 some year
ago.

I think it breaks when it tries to get the data ready for the SQL
statement.

In this project I have to use django-pyodbc connector to MSSQL
database.

I have tried both 1.02 and 1.1b branches of the connector with same
errorous results.

It's the most frustrating bug in django so far, as I'm completely
helpless and even google's silent about this.

Please does anyone know what's causing this, or how to get rid of
it...

thanks,

Ales

--~--~---------~--~----~------------~-------~--~----~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to