I've got a model that includes FloatFields as well as IntegerFields and
CharFields.
When I access the CharFields, I get strings. When I access the
IntegerFields, I get integers, but when I want to use the Floatfields, I
always have to add float() to convert the string to an actual float. Not
that big a deal, but I always forget it first time around, and it just
doesn't feel right.

Here's a brief test :
>>> c = Camp.objects.get(pk=1)
>>> c.min_age
'17.0'
>>> a = c.min_age
>>> type(a)
<type 'str'>

And here's the corresponding field definition :
    min_age = models.FloatField("Minimum age", max_digits=3,
decimal_places=1, default=0, validator_list=[age_validator])

Why is this ?

I'm using 0.96 with a MySQL backend.

Chris Brand



--~--~---------~--~----~------------~-------~--~----~
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