On Tue, 2006-12-26 at 00:58 -0800, ak wrote:
Malcolm Tredinnick wrote:
> It's difficult to understand this without knowing more about the initial
> problem. What are the types and values of the user.tariff.monthly_fee
> and user.balance?



Well I thought it was clean from the subject line.
Both values are FloatField(max_digits=10, decimal_places=4, default=0)
and are taken from MySQL database fields of type double NOT NULL
default '0'

Since we are talking about a possible bug in Django, it's important to
see what is *really* happening at the point the problem occurs, not what
we hope is happening based on how the field was declared. You posted a
line of code that you say does not work as expected. So, at the time
that line is executed, what are the types and values of the variables
involved (it will not be FloatField, because of the way Django abstracts
away the database interaction; it will be a more pure Python type
hopefully).

Put in some debugging prints just before you run the comparison to print
out the type() and values, preferably for a case where you would expect
the if statement to evaluate as true. Then we can maybe work out why the
comparison is giving the wrong answer.

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