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

211
Views
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
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!