Example #1
0
def new_task(request):
    form = TaskForm(request.POST or None)
    if form.is_valid():
        form.save()
        return redirect('home')

    return render(request, 'new_task.html', {'form': form})
Example #2
0
def home(request):
	task_list = Task.objects.filter(parent=None)
	form = TaskForm(request.POST or None)
	if form.is_valid():
		form.save()
	return render(request, 'home.html', locals())