Hello group,

I've stumbled upon sth. where I'm not sure if this is an intended
behaviour or not. I tried to dump my db-data to a json-fixture and
load it again, where I got the error that a float-value can't be
converted to Decimal (using postgres with psycopg2). I traced the
problem back and set up a Test-application with models.py, settings.py
and a little run.py that creates an entry in my test-db. I've pasted
all together with the fixture I get from dumpdata and the error when
trying to load it:
http://dpaste.com/hold/23003/

As far as I can see, the problem lies in the __init__ of the model. If
the float-value I create here would be created directly, everything is
fine and I get a string-conversion of the float-value in the fixture,
which I can load without problems. But in this case, even if I
manually put "" around the float and load it, the __init__ always
creates a new random value. Surely I could work around this problem by
taking the code out of __init__, but I'd like to know why django
behaves this way; or could it even be a bug?

Regards,
Andreas


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected]
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