def get(self): owner_email = self.request.get('task_owner') task_title = self.request.get('task_title') task = model.get_task(owner_email, task_title) owner_display_name = model.get_name_by_email(owner_email) owner_rating = model.get_rating(owner_email) if task: response_content = { 'task_title': task.title, 'task_category': task.category, 'task_type': task.type, 'task_detail': task.description, 'task_location': task.task_location, 'destination': task.final_dest, 'task_status': task.status, 'task_owner': task.owner_email, 'owner_name': owner_display_name, 'extra_credit': task.credit, 'rating': owner_rating, 'task_id': task.key.id(), 'helper_email': task.helper, 'helpee_email': task.helpee } self.response.headers['Content-Type'] = 'application/json' self.response.out.write(json.dumps(response_content))
while(True): ui.print_menu() user_input = logic.user_input("Please Enter your selection: ") if user_input == "1": task = logic.user_input("Please enter your task: ") progress = logic.user_input("Please enter your task progress: ") model.insert_task(task) model.insert_progress(task, progress) #makes program pause logic.user_input("Press any key to continue") elif user_input == "2": course = logic.user_input("Please enter your task to be queried") # query dictionary if model.get_task(course): ui.print_progress(course, model.get_progress(course)) else: ui.print_message("Sorry this task has not been added") logic.user_input("Press any key to continue") elif user_input == "3": many = False for task in model.get_tasks(): ui.print_progress(task, model.get_progress(task), many) many = True if len(model.get_tasks()) == 0: ui.print_message("No task added yet ") #pause program for some time logic.user_input("Press any key to continue ") else: ui.print_message("Good-bye Thanks for Using Progress Tracker")
def view_task(id): task_from_db = model.get_task(g.db, id) return render_template("view_task.html", task=task_from_db)
def view_task(id): # db = model.connect_db() - took out when added global db call task_from_db = model.get_task(g.db, id) return render_template("view_task.html", task=task_from_db)
def view_task(id): db = model.connect_db() task_from_db = model.get_task(db, id) return render_template("view_task.html", task=task_from_db)
def GET(self, id): return model.get_task(id).tittle