コード例 #1
0
 def POST(self):
     if self.input['oper'] == 'del':
         d = Delete(self.input)
         return d.delete()
     elif self.input['oper'] == 'edit':
         u = Update(self.input)
         return u.update()
コード例 #2
0
ファイル: manage.py プロジェクト: actank/zmon
 def POST(self):
     if self.input['oper'] == 'del':
         d = Delete(self.input)
         return d.delete()
     elif self.input['oper'] == 'edit':
         u = Update(self.input)
         return u.update()
コード例 #3
0
ファイル: test.py プロジェクト: han-sha/alpha-calendar
def delete(jdID, content):
	date, time, detail = content['dDate'], content['dSTime'], content['dEvent']
	year, month, day, hour, minute, __, detail = get_properties(date=date, time=time, detail=detail)
	nearest = True if 'value' in content['nearest'] else False
	#print(nearest)
	selftime = None if 'value' not in content['SeTime'] else content['SeTime']['value']
	cmd = None if 'value' not in content['dAll'] else content['dAll']['value']
	cmd = cmd if nearest is False else '最近一次'
	event = Event(jdID=jdID, year=year, month=month, 
		day=day, hour=hour, minute=minute, event_detail=detail, isDelete=True)

	delete = Delete(db=db, jdID=jdID, event=event, selftime=selftime, cmd=cmd)

	rst = delete.delete()

	return rst