Skip to content

Instantly share code, notes, and snippets.

@rafaelchagasb
Created February 27, 2012 01:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rafaelchagasb/1920478 to your computer and use it in GitHub Desktop.
Save rafaelchagasb/1920478 to your computer and use it in GitHub Desktop.
views.py
def index(request):
MapImageFormSet = inlineformset_factory(MapData,Imagem)
if request.method == 'POST':
form = MapImageFormSet(request.POST,request.FILES)
if form.is_valid():
form.save()
mostrar = 'Salvo!'
form = MapImageFormSet()
else:
form = MapImageFormSet()
return render_to_response(
'ponto/index.html',
locals(),
context_instance=RequestContext(request),
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment