Skip to content

Instantly share code, notes, and snippets.

@daikeren
Created August 27, 2012 03:07
Show Gist options
  • Select an option

  • Save daikeren/3485223 to your computer and use it in GitHub Desktop.

Select an option

Save daikeren/3485223 to your computer and use it in GitHub Desktop.
from django.shortcuts import render
from django.http import HttpResponse
from forms import POIForm
def poiadd(request):
form = POIForm(initial={'name': 'test'})
if request.method == 'POST':
form = POIForm(request.POST)
form.name = "test"
if form.is_valid():
return HttpResponse('OK')
else:
return render(request, 'test.html', {'poi_form': form })
return render(request, 'test.html', {'poi_form': form })
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment