Created
August 25, 2010 21:23
-
-
Save emilepetrone/550323 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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