def add request if request method POST form AddForm request POST if fo

1
2
3
4
5
6
7
8
def add(request):
if request.method == 'POST':
form = AddForm(request.POST),
if form.is_valid:
form.save()
else:
form = AddForm()
return render_to_response('addtasks.html', {'form': form})