Skip to content

Instantly share code, notes, and snippets.

@emilepetrone
Created August 25, 2010 21:23
Show Gist options
  • Save emilepetrone/550323 to your computer and use it in GitHub Desktop.
Save emilepetrone/550323 to your computer and use it in GitHub Desktop.
class VoteHandler(webapp.RequestHandler):
#read value of counter, calculate new value, then store it
def get(self):
doRender(self, 'base/index.html')
def post(self):
#See if logged in
self.Session = Session()
if not 'userkey' in self.Session:
doRender(
self,
'/',
{'error' : 'Please login to vote'})
return
#Get current vote total
current_total = URL.website.votes #This must be wrong
current_total += 1
current_total.put()
self.get();
doRender(self,'base/index.html', { })
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment