Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

214
Vistas
How to update user status (multiple user at a time used checkall ids)?

my concern is user is selecting all id's and update the user status(eg :status='assign')?

im getting this url with multiple ids(when i checkall) http://127.0.0.1:9000/assignagent/id/20,21,22,23,24,25,26,27

this is my actual url

path('assignagent/id/int:pk',views.SciBulkAssignView.as_view(),name='assignagent')

views.py

class SciBulkAssignView(UpdateView):
      login_url = 'login'
      model = Sci1stKey
      fields = ['id','projectId','status']
      initial = {'status': 'assign'}
      template_name = 'all_adminhtmlpages/updatesci_details.html'
      success_url = reverse_lazy('reassigntickets')

and another view i tried also

# def assignagent(request, id):
      top = get_object_or_404(Sci1stKey, id=id)
      top.status ='assign'
      top.save(update_fields=['status'])
      return redirect('assigntickets')

this is my html and js code im selecting all ids need to update the status of id( checkboxes)

<input type="button" class="main" value="selectall" onclick="checkAll()" name="inputs">

           <button type="button" value="deselectAll" class="main" onclick="uncheckAll()">Clear</button>



<script type="text/javascript">
     // Select all check boxes : Setting the checked property to true in checkAll() function
       function checkAll(){
         var items = document.getElementsByName('brand');
         var checkedValue = [];
           for (var i = 0; i < items.length; i++) {
               if (items[i].type == 'checkbox')
                   items[i].checked = true;
                   checkedValue.push(items[i].value) ;

           }
           console.log(checkedValue);
           url = '/assignagent/id/' + checkedValue;
                window.location.replace(url);
       }
     // Clear all check boxes : Setting the checked property to false in uncheckAll() function
       function uncheckAll(){
         var items = document.getElementsByName('brand');
           for (var i = 0; i < items.length; i++) {
               if (items[i].type == 'checkbox')
                   items[i].checked = false;
           }
       }
  </script>
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda