def post(self): try: c = Comment.get_by_id(int(self.request.get('sankaid'))) db.delete(c) # MainHandlerへリダイレクト self.redirect('/insert?kaisaibi=' + self.request.get('kaisaibi')) except: self.redirect('/')
def post(self): try: c = Comment.get_by_id(int(self.request.get('sankaid'))) c.kaisaibi = self.request.get('kaisaibi') c.chara_name = self.request.get('chara_name') c.chara_class = self.request.get('chara_class') c.sanka = self.request.get('sanka') c.comment_text = self.request.get('comment_text') c.tourokudate_text = datetime.datetime.now(JST()).strftime('%Y-%m-%d %H:%M:%S') c.tourokudate = datetime.datetime.now(JST()) c.put() # MainHandlerへリダイレクト self.redirect('/insert?kaisaibi=' + self.request.get('kaisaibi')) except: self.redirect('/')
def get(self): import define try: c = Comment.get_by_id(int(self.request.get('sankaid'))) if(c is None): self.redirect('/') return ss = c.kaisaibi.split('-') youbi = u"月 火 水 木 金 土 日".split()[datetime.datetime(int(ss[0]),int(ss[1]),int(ss[2])).weekday()] template_values = {'data': c, 'youbi': youbi, } #path = os.path.join(os.path.dirname(__file__), 'templates/delete.html') path = os.path.join(os.path.dirname(__file__), 'templates/deletes.html' if define.isMobile(self) else 'templates/delete.html') self.response.out.write(template.render(path, template_values)) except: self.redirect('/')
def getSankaLists(kaisaibi): lst = [] for n in range(9): lst.append([]) for s in Comment.gql(' WHERE kaisaibi = :kaisaibi ORDER BY class_id, tourokudate_text ', kaisaibi = kaisaibi): #s.comment_text = define.split_text(s.comment_text, 20) s.bgcolor = ClassList.clscolor.get(s.chara_class.upper(), '') sanka = s.sanka if (sanka == u'参加'): if (s.chara_class.upper() in ClassList.flist): lst[0].append(s) elif (s.chara_class.upper() in ClassList.slist): lst[1].append(s) elif (s.chara_class.upper() in ClassList.plist): lst[2].append(s) elif (s.chara_class.upper() in ClassList.mlist): lst[3].append(s) elif (sanka == u'遅刻') or (sanka == u'補欠'): if (s.chara_class.upper() in ClassList.flist): lst[4].append(s) elif (s.chara_class.upper() in ClassList.slist): lst[5].append(s) elif (s.chara_class.upper() in ClassList.plist): lst[6].append(s) elif (s.chara_class.upper() in ClassList.mlist): lst[7].append(s) elif (sanka == u'お休み'): lst[8].append(s) return lst[0], lst[1], lst[2], lst[3], lst[4], lst[5], lst[6], lst[7], lst[8]
def post(self): b = 1 kyou = datetime.datetime.now(JST()).strftime('%Y-%m-%d') year = int(kyou[0:4]) month = int(kyou[5:7]) if((month - b) < 1): month = month + 12 - b year -= 1 else: month -= b sonohi = datetime.date(year, month, 1).strftime('%Y-%m-%d') for s in Comment.gql(' WHERE kaisaibi < :kaisaibi', kaisaibi = sonohi): s.delete() try: ymd = self.request.get('kaisaibi').split('-') theday = datetime.date(int(ymd[0]), int(ymd[1]), int(ymd[2])) except ValueError: theday = datetime.datetime.now(JST()) self.redirect('/insert?kaisaibi=' + theday.strftime('%Y-%m-%d'))
def get(self): import define try: c = Comment.get_by_id(int(self.request.get('sankaid'))) if(c is None): self.redirect('/') return tt = TagTool(c.chara_class, c.sanka) ss = c.kaisaibi.split('-') #youbi = u"日 月 火 水 木 金 土".split()[ datetime. datetime(int(ss[0]),int(ss[1]),int(ss[2])).isoweekday()] youbi = u"月 火 水 木 金 土 日".split()[datetime.datetime(int(ss[0]),int(ss[1]),int(ss[2])).weekday()] template_values = {'data': c, 'youbi': youbi, 'clstag': tt.getClsTag(), 'snktag': tt.getSankaTag(), } path = os.path.join(os.path.dirname(__file__), 'templates/edit.html') path = os.path.join(os.path.dirname(__file__), 'templates/edits.html' if define.isMobile(self) else 'templates/edit.html') self.response.out.write(template.render(path, template_values)) except: self.redirect('/')
def post(self): try: c = Comment() c.kaisaibi = self.request.get('kaisaibi') c.chara_name = self.request.get('chara_name') c.chara_class = self.request.get('chara_class') c.sanka = self.request.get('sanka') c.comment_text = self.request.get('comment_text') c.tourokudate_text = datetime.datetime.now(JST()).strftime('%Y-%m-%d %H:%M:%S') c.tourokudate = datetime.datetime.now(JST()) c.class_id = ClassList.alist.index(c.chara_class) c.put() if(self.request.get('onaji') == 'yes'): c = Comment() c.kaisaibi = (datetime.datetime.strptime(self.request.get('kaisaibi'), '%Y-%m-%d') + datetime.timedelta(1)).strftime('%Y-%m-%d') c.chara_name = self.request.get('chara_name') c.chara_class = self.request.get('chara_class') c.sanka = self.request.get('sanka') c.comment_text = self.request.get('comment_text') c.tourokudate_text = datetime.datetime.now(JST()).strftime('%Y-%m-%d %H:%M:%S') c.tourokudate = datetime.datetime.now(JST()) c.class_id = ClassList.alist.index(c.chara_class) c.put() # MainHandlerへリダイレクト self.redirect('/insert?kaisaibi=' + self.request.get('kaisaibi')) except: self.redirect('/')