コード例 #1
0
def restart_task(request, pk, list_id):
	task = Task(id = pk, tasklist_id=list_id)
	task.description = Task.objects.get(pk=pk).description
	task.is_complete = False
	task.completed_at = None
	task.save()
	return redirect('task:task_display', list_id)
コード例 #2
0
def complete_task(request, pk, list_id):
	task = Task(id = pk, tasklist_id=list_id)
	task.description = Task.objects.get(pk=pk).description
	task.is_complete = True
	task.completed_at = timezone.now()
	task.save()
	return redirect('task:task_display', list_id)