cgitb.enable() from objetos.dbConn.FormatData import FormatData from objetos.tarefas.Tarefa import Tarefa from objetos.tarefas.TarefaDAO import TarefaDAO codTarefa = 0 form = cgi.FieldStorage() if form: codTarefa = int(form.getvalue("cod")) obj = Tarefa() dao = TarefaDAO() print("Content-type: application/json\n") saida = "" saida += """ { "tarefa": [""" obj = dao.select(codTarefa) saida += """ {} "codTarefa": {}, "codTarefaPai": {},
import cgitb cgitb.enable() from datetime import datetime from objetos.dbConn.FormatData import FormatData from objetos.tarefas.Tarefa import Tarefa from objetos.tarefas.TarefaDAO import TarefaDAO codTarefa = 0 form = cgi.FieldStorage() obj = Tarefa() dao = TarefaDAO() #Inicia ou termina uma subtarefa #print("Content-type: text/html\n") if str(form) != "FieldStorage(None, None, '')": codTarefa = int(form.getvalue("cod")) tarefa = dao.select(codTarefa) if form.getvalue("oper") == "ini": tarefa.setInicio(datetime.now()) elif form.getvalue("oper") == "fim": tarefa.setFim(datetime.now()) tarefa.setTerminado(True)