diff --git a/network_inventory/inventory/templates/inventory/list_of_lists.html b/network_inventory/inventory/templates/inventory/list_of_lists.html
new file mode 100644
index 0000000..ff2c574
--- /dev/null
+++ b/network_inventory/inventory/templates/inventory/list_of_lists.html
@@ -0,0 +1,15 @@
+{% extends "inventory/base.html" %}
+{% block section_title %}List of Lists{% endblock %}
+{% block content %}
+
+{% endblock %}
diff --git a/network_inventory/inventory/urls.py b/network_inventory/inventory/urls.py
index 5a3d11e..efde4dd 100644
--- a/network_inventory/inventory/urls.py
+++ b/network_inventory/inventory/urls.py
@@ -9,7 +9,8 @@ urlpatterns = [
path('device//', views.device_details, name='device'),
path('computer//', views.computer_details,
name='computer'),
- path('devices/', views.DeviceList.as_view(), name='devices'),
+ path('devices/', views.DeviceList.as_view(),
+ name='devices'),
path('customer//lists/', views.list_of_lists,
name='lists'),
]
diff --git a/network_inventory/inventory/views.py b/network_inventory/inventory/views.py
index dcfb73d..5925a35 100644
--- a/network_inventory/inventory/views.py
+++ b/network_inventory/inventory/views.py
@@ -29,7 +29,8 @@ def computer_details(request, computer_id):
def list_of_lists(request, customer_id):
- return render(request, 'inventory/list_of_lists.html')
+ return render(request, 'inventory/list_of_lists.html',
+ {'customer_id': customer_id})
class CustomerList(ListView):
@@ -56,3 +57,8 @@ class DeviceList(ListView):
model = Device
context_object_name = 'device_list'
template_name = 'inventory/device_list.html'
+
+ def get_queryset(self):
+ queryset = Device.objects.filter(customer=self.kwargs['customer_id'])
+ return queryset
+