Example #1
0
def create(request):
	if request.method == 'POST':
		new_data = request.POST.copy()
		form = NoteForm(new_data)
		if form.is_valid():
			note = Note()
			note.body = form.cleaned_data['body']
			note.tags = form.cleaned_data['tags']
			note.allow_comments = form.cleaned_data['allow_comments']
			note.private = form.cleaned_data['private']
			note.store()
	
	form = NoteForm()
	return render_to_response('notes/form.html', { 'form': form }, context_instance=RequestContext(request))