def RegistrarArticulo(request): if request.method == 'POST': form = ArticuloForm(request.POST) if form.is_valid(): form.save() return HttpResponseRedirect('/localidad/confirma/') else: form = ArticuloForm() return render_to_response('negocio/articulo.html',{'form':form}, context_instance=RequestContext(request))
def crear(request): if request.POST: form = ArticuloForm(request.POST) if form.is_valid(): form.save() return HttpResponseRedirect('/') else: form = ArticuloForm() args = {} args.update(csrf(request)) args['form'] = form return render_to_response('crear_articulo.html', args)