mirror of
https://github.com/Nebucatnetzer/network_inventory.git
synced 2024-07-01 05:30:57 +02:00
add an index view
This commit is contained in:
parent
6d0231f9f6
commit
d4a20bd57d
|
@ -376,6 +376,16 @@ admin.site.register(CronJob)
|
||||||
from django.shortcuts import get_object_or_404, render
|
from django.shortcuts import get_object_or_404, render
|
||||||
|
|
||||||
|
|
||||||
|
def index(request):
|
||||||
|
device_list = Device.objects.all()
|
||||||
|
computer_list = Computer.objects.all()
|
||||||
|
|
||||||
|
return render(request,
|
||||||
|
'inventory/index.html',
|
||||||
|
{'device_list': category_list,
|
||||||
|
'computer_list': computer_list})
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
* Templates
|
* Templates
|
||||||
|
|
||||||
Templates define the look of the application and where things get
|
Templates define the look of the application and where things get
|
||||||
|
|
|
@ -1,2 +1,12 @@
|
||||||
#!/usr/bin/python3
|
#!/usr/bin/python3
|
||||||
from django.shortcuts import get_object_or_404, render
|
from django.shortcuts import get_object_or_404, render
|
||||||
|
|
||||||
|
|
||||||
|
def index(request):
|
||||||
|
device_list = Device.objects.all()
|
||||||
|
computer_list = Computer.objects.all()
|
||||||
|
|
||||||
|
return render(request,
|
||||||
|
'inventory/index.html',
|
||||||
|
{'device_list': category_list,
|
||||||
|
'computer_list': computer_list})
|
||||||
|
|
Loading…
Reference in New Issue
Block a user