1. gao shuai
  2. wd-kcb-hg

Commits

gao shuai  committed ce36f92

fix quickADD

  • Participants
  • Parent commits 88c14ac
  • Branches default

Comments (0)

Files changed (3)

File app.yaml

View file
  • Ignore whitespace
 - url: /robots.txt
   static_files: static/robots.txt
   upload: static/robots.txt
+- url: /_quickadd
+  script: kcbuser.py
 - url: /admin
   script: kcbuser.py
   login: required

File kcbuser.py

View file
  • Ignore whitespace
 			user=self.request.get('key')
 			USER=db.get(self.request.get('key'))
 			if USER.quickPassword==Password:
-				pass
+				NowTerm=db.get(db.get(user).nowterm)
+				kw=[cgi.escape(self.request.get('kcbweek'))]
+				kw=rkw(kw)
+				KCB = kcb()
+				KCB.name = cgi.escape(self.request.get('kcbname'))
+				KCB.day  = int(cgi.escape(self.request.get('kcbday')))
+				KCB.time = int(cgi.escape(self.request.get('kcbtime')))
+				KCB.week = kw[0]
+				KCB.place = cgi.escape(self.request.get('kcbplace'))
+				KCB.term=NowTerm.key()
+				KCB.put()
+				self.redirect('/%s'%USER.url)
+				return;
 			else:
 				self.redirect('/admin')
 				return;
 										[
 										('/admin', AdminMainPage),
 										('/admin/add', AddItemHandler),
+										('/_quickadd', AddItemHandler),
 										('/admin/del',DeleteHandler),
 										('/signin', LoginRouter),
 									 ('/signout', LogoutHandler),

File tpl/bingo.html

View file
  • Ignore whitespace
 <br />
 
 
-      <form action="/admin/add" method="post">
+      <form action="/_quickadd" method="post">
 
 	<input type="text" name="kcbname"  />名称<br />