-
Notifications
You must be signed in to change notification settings - Fork 0
/
story.py
36 lines (23 loc) · 1021 Bytes
/
story.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
from google.appengine.ext import webapp
from google.appengine.ext.webapp import util
from google.appengine.api import users
from models import Story
import appengineutils
class Handler(webapp.RequestHandler):
def get(self, story_id):
story = Story.get_by_story_id(story_id)
appengineutils.render_template(self.response, 'story.html', {"story" : story,
"estimate_options": range(0, 11)})
def post(self, story_id):
story = Story.get_by_story_id(story_id)
story.name = self.request.get('name')
story.java_estimate = int(self.request.get('java_estimate'))
story.cs_estimate = int(self.request.get('cs_estimate'))
story.user = users.get_current_user()
story.put()
self.redirect('/s/' + story.story_id)
def main():
application = webapp.WSGIApplication([('/p/(.*)', Handler)], debug=True)
util.run_wsgi_app(application)
if __name__ == '__main__':
main()