def POST(self): if not self.form.validates(): return render.setDate(self.form, str(model.get_current_time())) else: parsed_time = datetime.datetime( int(self.form.year.value), int(self.form.month.value), int(self.form.day.value), int(self.form.hour.value), int(self.form.minute.value), int(self.form.second.value) ) model.set_current_time(parsed_time) return render.setDate(self.form, str(model.get_current_time()))
def __init__(self): self.form = setDateForm() current_time = model.get_current_time() self.form.year.value=current_time.year self.form.month.value=current_time.month self.form.day.value=current_time.day self.form.hour.value=current_time.hour self.form.minute.value=current_time.minute self.form.second.value=current_time.second
def GET(self): return render.setDate(self.form, str(model.get_current_time()))