Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

287
Views
django cómo eliminar el objeto de consulta de la plantilla

¿Cómo puedo eliminar un objeto del conjunto de consultas cuando hago clic en algún botón en la plantilla para la vista Django?

aqui esta mi codigo...

HTML ingrese la descripción de la imagen aquí

vistas.py

 def CamerasList(request): model = Cameras # This function can hadle both the retrieval of the view, as well as the submission of the form on the view. if request.method == 'POST': form = CamerasForm(request.POST, request.FILES) if form.is_valid(): form.delete_cam_id = request.POST.get('delete_cam_id') deletelement = Cameras.objects.get(pk=form.delete_cam_id) deletelement.delete() var = {} var = user_group_validation(request) theuser = request.user theuserid = Users.objects.get(user_id=theuser.id).pk theorgid = Users.objects.get(pk=theuserid).organization_id.pk if var['grupo'] == 'superuser': object_list = Cameras.objects.all() organization = Organizations.objects.all() url = request.session['url'] if var['grupo'] == 'admin' or var['grupo'] == 'user': object_list = Cameras.objects.filter(organization_id=request.session['userInc']) organization = Organizations.objects.filter(id=request.session['userInc']) url = request.session['url'] template = get_template(app+u'/cameras_list.html') return HttpResponse(template.render(locals()))
over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!