On Sun, 2008-11-30 at 01:34 -0800, Ulf Kronman wrote:
> Hi Malcolm,
> 
> > I forgot to mention this in my last reply, but you didn't actually
> > answer the question that Karen asked. If you open up a Python prompt on
> > your machine and do this:
> >
> >         >>> import decimal
> >         >>> decimal.Decimal('1.0')
> >
> > does it raise an exception?
> 
> Sorry, I forgot to report on that part, but I did that without any
> problem. Here is the check:
> 
> Python 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit
> (Intel)] on win32
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import decimal
> >>> decimal.Decimal('1.0')
> Decimal("1.0")
> >>>

So Decimal isn't fundamentally broken on Python on Windows (not too
surprising).

> Also sorry for seemingly forking the issue in two threads, but this
> was an effect of me (being a confused non-programmer) trying to sort
> things out and respond to your suggestions, respectively.

Yeah, no worries. I realised you were trying to respond to both
sub-threads at once, so I was trying to pull things back together a bit.

> 
> I'll read and try to understand and follow your suggestions for
> checking on locale before and after the database call and get back
> with a report on that.
> 
> I've already hardcoded variable values as you suggest and sent them
> off to the template before the database call (lst_result = cur.fetchall
> ()), and at that point floatformat works fine with a decimal point
> (and a string with decimal comma breaks the floatformat).
> 
> Sending hardcoded variable values on the line after the database call
> gives the opposite result; values with decimal point break the
> floatformat, but strings with decimal comma don't break floatformat,
> but are on the other hand not displayed after doing floatformat.

Okay, that's useful. It really strongly suggests that it's the database
wrapper you've got that is breaking things by doing something with the
locale. That would be a fairly serious bug in that code if you're able
to narrow it down. You should be able to construct a small repeatable
test case that doesn't involve Django at all, which will help narrow
down the problem. Sounds a lot like a pymssql bug at the moment.

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