def RegistrarMunicipio(request): if request.method == 'POST': form = MunicipioForm(request.POST) if form.is_valid(): form.save() return HttpResponseRedirect('/localidad/confirma/') else: form = MunicipioForm() return render_to_response('localidad/municipio.html',{'form':form}, context_instance=RequestContext(request))
def RegistrarMunicipio(request): if not request.user.is_staff: return HttpResponse("<h1>Acceso restringido consulte al administrador</h1>") if request.method == 'POST': form = MunicipioForm(request.POST) if form.is_valid(): form.save() return HttpResponseRedirect('/localidad/confirma/') else: form = MunicipioForm() return render_to_response('localidad/municipio.html',{'form':form}, context_instance=RequestContext(request))
def RegistrarMunicipio(request): if not request.user.is_staff: return HttpResponse( "<h1>Acceso restringido consulte al administrador</h1>") if request.method == 'POST': form = MunicipioForm(request.POST) if form.is_valid(): form.save() return HttpResponseRedirect('/localidad/confirma/') else: form = MunicipioForm() return render_to_response('localidad/municipio.html', {'form': form}, context_instance=RequestContext(request))