Note that there are some explanatory texts on larger screens.

plurals
  1. POBadValueError('Property %s must be a float' % self.name) BadValueError: Property USD must be a float
    primarykey
    data
    text
    <p>I am having a problem with my Google App Engine Program. I have been staring at it for a few hours now, and don't what the solution is. I have seen another relevant question <a href="https://stackoverflow.com/questions/10012476/badvalueerror-property-category-is-required-on-gae">&quot;BadValueError: Property category is required&quot; on GAE</a>, but even when I remove the "required=True" condition from both the user and USD variables, I receive the same error.</p> <p>My program does a simple conversion of USD currency to SR currency. Unfortunately, I keep getting the error: BadValueError('Property %s must be a float' % self.name) BadValueError: Property USD must be a float</p> <p>code from my main.py</p> <pre><code>import webapp2 from google.appengine.ext import db from google.appengine.ext.webapp import template class Convert(db.Model): user = db.StringProperty(required=True) USD = db.FloatProperty(required=True) SR = db.FloatProperty() class MainHandler(webapp2.RequestHandler): def get(self): conversion=db.GqlQuery('SELECT * FROM Convert') values={'conversion':conversion} self.response.out.write(template.render('main.html',values)) def post(self): prog= Convert(user=(self.request.get('userName')),USD=((float)self.request.get('currency'))),SR=((float)(self.request.get('currency')*3.75))) prog.put() self.redirect('/') app = webapp2.WSGIApplication([('/', MainHandler)], debug=True) </code></pre> <p>code from my main.html</p> <pre><code> &lt;tr&gt;&lt;td&gt;{% for a in conversion%} &lt;div align="right" lang="ar"&gt;&lt;font size="+1" color="#000000"&gt;&lt;strong&gt;&lt;font color="#009999"&gt;{{a.user}}أدخل:&lt;/font&gt; {{a.USD}}&lt;font color="#990000"&gt;م&lt;/font&gt; = {{a.SR}}{% endfor %} &lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt; &lt;form action="" method="post" accept-charset="utf-8"&gt; &lt;p align="right" dir="rtl"&gt;&lt;strong&gt;&lt;font color="#003366"&gt;أدخل الدولار الأمريكي:&lt;/font&gt;&lt;/strong&gt;&lt;input type="text" name="currency" value="" id="currency"&gt;&lt;/input&gt;&lt;/p&gt; &lt;p align="right" dir="rtl"&gt;&lt;strong&gt;&lt;font color="#003366"&gt;الرجـاء إدخــال اسمـك:&lt;/font&gt;&lt;/strong&gt;&lt;input type="text" name="userName" value="" id="userName"&gt;&lt;/input&gt;&lt;/p&gt; &lt;p align="right"&gt;&lt;input type="submit" value="تحويل العملة"&gt;&lt;/input&gt;&lt;/p&gt; &lt;/form&gt; &lt;/td&gt;&lt;/tr&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload