SHARE
TWEET

Untitled

a guest Jun 16th, 2019 43 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. views.py
  2.  
  3. @login_required #necesita logearse para ver su informacion
  4. def index(request):
  5. """Datos del UsrDentro""" #Los datos consultados en el html, se ven por medio de
  6. args = {'user': request.user} #{{ user.'nombre del campo del modelo'}}
  7. return render(request, "plantillas/base.html", args)
  8.  
  9.  
  10. def target_sum(request):
  11. """Gestion de solicitudes"""#Controller del formuladorio
  12. if request.method == 'POST': # View donde deseo hacer la operacion aritmetica
  13.     form = addForm(request.POST, instance=request.user)
  14.     if form.is_valid():
  15.         form.save()
  16.     return redirect ('send')
  17. else:
  18.     form = addForm(instance=request.user)
  19. return render (request, 'plantillas/adicionar.html', {'form':form})
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top