-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
50 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,11 @@ | ||
from django.contrib import admin | ||
|
||
# Register your models here. | ||
|
||
from .models import Kupot | ||
from .models import Reports | ||
from .models import AssetDetails | ||
|
||
admin.site.register(Kupot) | ||
admin.site.register(Reports) | ||
admin.site.register(AssetDetails) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,38 @@ | ||
from django.shortcuts import render | ||
from importer import models | ||
from django.http import HttpResponse | ||
|
||
root="/" | ||
# Create your views here. | ||
def companies(request): | ||
output = "רשימת החברות:<br><select size= 4 onchange='window.location.replace(\"/\"+this.options[this.selectedIndex].innerHTML)'>" | ||
company_list = models.Kupot.objects.values().distinct() | ||
for k in company_list: | ||
output = output+"<option value="+str(k["id"])+">"+k["company"]+"</option>" | ||
output = output+"</select>" | ||
return HttpResponse(output) | ||
|
||
def kupot(request, company_name): | ||
output = "רשימת מסלולים ל"+company_name+":<br><select size = 10 \ | ||
onchange=window.location.replace(\"/\duchot/\"+this.options[this.selectedIndex].value+\"/\"+this.options[this.selectedIndex].innerHTML)>" | ||
company_list = models.Kupot.objects.values().filter(company=company_name) | ||
for k in company_list: | ||
output = output+"<option value="+str(k["id"])+">"+k["track"]+"</option>" | ||
output = output+"</select><br><button onclick='window.location.replace(\"/\")'>back</button>" | ||
return HttpResponse(output) | ||
|
||
def duchot(request, kupa_id, kupa): | ||
output = "רשימת דוח\"ות ל"+str(kupa)+":<br><select size = 10 onchange='window.location.replace(\"/tabs/\"+this.options[this.selectedIndex].value+\"/\"+this.options[this.selectedIndex].innerHTML)'>" | ||
report_list = models.Reports.objects.values().filter(kupa_id=kupa_id) | ||
for k in report_list: | ||
output = output+"<option value="+str(k["id"])+">"+str(k["report_date"])+"</option>" | ||
output = output+"</select><br><button onclick='window.location.replace(\"/\")'>back</button>" | ||
return HttpResponse(output) | ||
|
||
def tabs(request, report_id, report_date): | ||
output = "רשימת טאבים:<br><select size = 10 onchange='window.location.replace(\"/details/\"+report_id+\"/\"+this.options[this.selectedIndex].innerHTML)'>" | ||
tab_list = models.AssetDetails.objects.values("category").filter(reports_id=report_id).distinct() | ||
for k in tab_list: | ||
output = output+"<option>"+k["category"]+"</option>" | ||
output = output+"</select><br><button onclick='window.location.replace(\"/\")'>back</button>" | ||
return HttpResponse(output) |