import cgi
from google.appengine.ext import db
from google.appengine.api import users
from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app
class Serial(db.Model):
game = db.StringProperty(required=True)
serial = db.StringProperty(required=True)
class MainPage(webapp.RequestHandler):
def get(self):
self.response.out.write("""
<html>
<body>
<form action="/sign" method="post">
Game:
<input type="text" name="txtGame">
<br>
Serial:
<input type="text" name="txtSerial"
<br
<input type="submit" name="btnSubmit" value="Submit">
</form>
</body>
</html>""")
class Insert(webapp.RequestHandler):
def post(self):
serial = Serial()
serial.game = self.request.get('txtGame')
serial.serial = self.request.get('txtSerial')
serial.put()
application = webapp.WSGIApplication(
[('/', MainPage),
('/sign', Insert)],
debug=True)
def main():
run_wsgi_app(application)
if __name__ == "__main__":
main()
When I run it i get this as output after i hit the submit button
Traceback (most recent call last):
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/
GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/
google/appengine/ext/webapp/__init__.py", line 501, in __call__
handler.post(*groups)
File "/Users/grout/Documents/projects/serials/main.py", line 32, in
post
serial = Serial()
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/
GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/
google/appengine/ext/db/__init__.py", line 555, in __init__
prop.__set__(self, value)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/
GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/
google/appengine/ext/db/__init__.py", line 372, in __set__
value = self.validate(value)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/
GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/
google/appengine/ext/db/__init__.py", line 1648, in validate
value = super(StringProperty, self).validate(value)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/
GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/
google/appengine/ext/db/__init__.py", line 399, in validate
raise BadValueError('Property %s is required' % self.name)
BadValueError: Property game is required
Really not sure what else it wants for property for game.
Any help would be great, im really stumped.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---