I wanna know how I run certain functions depending on the selected checkboxes. This is my visual template:
and this is the code I have for my template is called admin.html:
<div class="panel-body">
<p><button type="button" class="btn btn-black"><i class="fa fa-upload" </i> <span class="bold">IMPORT ALL</span></button> </p>
<p> Import selected reports:</p>
<p> <label><input type="checkbox" value=""> Cisco Backlog Report</label></p>
<p> <label><input type="checkbox" value=""> Planning & Standard</label></p>
<p> <label><input type="checkbox" value=""> Emo Trans Report</label></p>
<p> <label><input type="checkbox" value=""> Phyllis Report</label></p>
<p> <label><input type="checkbox" value=""> Purchase Order View</label></p>
<p> <label><input type="checkbox" value=""> On Hand Inventory</label></p>
<p> <label><input type="checkbox" value=""> Bill of Material</label></p>
<p> <label><input type="checkbox" value=""> Aged</label></p>
<p> <label><input type="checkbox" value=""> Shipment with Times</label></p>
<p><button type="button" class="btn btn-danger">Import</button> </p>
As I mentioned before, I got 10 functions that read several .csv reports and upload the data into models and I trigger them with the URL section. In my views.py I will show two examples:
def importpurchase(request)
Log logic here
def importcisco(request)
Log logic here
def importall(request) # this function is to import all
importpurchase(None)
importcisco(None)