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()
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