Hi

There is no conversion from int to float in the the 1.3.8 code base.

I would suggest you explicitly convert ints to floats before assigning
it the property

Also I couldn't find any reference to such an issue the appengine
issues tracker http://code.google.com/p/googleappengine/issues/list


Rgds

T

On Nov 4, 9:55 pm, Justin <[email protected]> wrote:
> Having a problem with the above - FloatProperty constructor  barfs
> when passed an int value.
>
> I saw a ticket which implied this problem had been raised and solved
>
> http://dev.pyamf.org/ticket/609
>
> however I still seem to be suffering, and I'm using the latest version
> [1.3.8]
>
> Thanks!
>
> --
>
> from google.appengine.ext import db
>
> class Foo(db.Model):
>     fl = db.FloatProperty()
>
> y = Foo(fl=3.0)
> x = Foo(fl=3)
>
> --
>
> Traceback (most recent call last):
>   File "/home/jhw/packages/google_appengine/google/appengine/ext/admin/
> __init__.py", line 218, in post
>     exec(compiled_code, globals())
>   File "<string>", line 7, in <module>
>   File "/home/jhw/packages/google_appengine/google/appengine/ext/db/
> __init__.py", line 813, in __init__
>     prop.__set__(self, value)
>   File "/home/jhw/packages/google_appengine/google/appengine/ext/db/
> __init__.py", line 542, in __set__
>     value = self.validate(value)
>   File "/home/jhw/packages/google_appengine/google/appengine/ext/db/
> __init__.py", line 2842, in validate
>     raise BadValueError('Property %s must be a float' % self.name)
> BadValueError: Property fl must be a float

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" 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/google-appengine?hl=en.

Reply via email to