#4211: FloatFields are not actually Floats
---------------------------------------------+------------------------------
Reporter:  David Cramer <[EMAIL PROTECTED]>  |       Owner:  jacob        
  Status:  new                               |   Component:  Uncategorized
 Version:  SVN                               |    Keywords:               
   Stage:  Unreviewed                        |   Has_patch:  0            
---------------------------------------------+------------------------------
 FloatFields should return a float() datatype so they can be used in
 comparison.
 
 The issue arises when you want to compare data in the database, to data
 thats not yet in the database.
 
 e.g.
 
 float_field = FloatField(decimal_places=2, max_digits=8)
 
 a = MyModel.objects.get(pk=1)
 In [57]: a.unknown3
 Out[57]: Decimal("0.00")
 
 In [58]: a.unknown3 == 0
 Out[58]: True
 
 In [59]: a.unknown3 == 0.0
 Out[59]: False
 
 In [60]: a.unknown3 == 0.00
 Out[60]: False
 
 This is misdirection and I believe one of the following should happen:
  * the data type should either be changed to a float
  * the data type should be comparable with a float
  * it should be relabeled DecimalField

-- 
Ticket URL: <http://code.djangoproject.com/ticket/4211>
Django Code <http://code.djangoproject.com/>
The web framework for perfectionists with deadlines
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" 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-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to