Ejemplo n.º 1
0
 def post(self):
     title = self.request.get("title")
     description = self.request.get("description")
     dueDate = self.request.get("dueDate")
     fixedDueDate = self.fixDueDate(dueDate)
     priority = self.request.get("priority")
     user = self.getUserFromCookie()
     userId = user.key().id()
     newTask = taskModel.Task(title = title,description = description, dueDate = dueDate, fixedDueDate = fixedDueDate, priority = priority,
                              userId = userId, parent=taskModel.taskAncestorKey(userId))
     newTask.put()
     self.redirect('/homepage')                  
Ejemplo n.º 2
0
 def get(self,taskId):
     user = self.getUserFromCookie()
     userId= user.key().id()
     task = taskModel.Task.get_by_id(int(taskId), parent = taskModel.taskAncestorKey(userId))    
     fields = {'user': user,'userTask':task}
     self.renderStart('templates/task.html',fields=fields)
Ejemplo n.º 3
0
 def getTasks(self, userId):
     tasksQuery = taskModel.Task.all()
     tasksQuery = tasksQuery.ancestor(taskModel.taskAncestorKey(userId))
     tasksQuery = tasksQuery.order(SortMethod)
     return tasksQuery