add a make command to remove the sqlite db restart the server
This commit is contained in:
parent
e162ec4177
commit
abba395440
5
Makefile
5
Makefile
|
@ -22,6 +22,11 @@ local:
|
||||||
./run.sh; \
|
./run.sh; \
|
||||||
)
|
)
|
||||||
|
|
||||||
|
.remove_db:
|
||||||
|
rm -f ./network_inventory/network_inventory/db.sqlite3
|
||||||
|
|
||||||
|
local_restart: .remove_db local
|
||||||
|
|
||||||
local_test:
|
local_test:
|
||||||
( \
|
( \
|
||||||
export DJANGO_SETTINGS_MODULE=network_inventory.settings.local; \
|
export DJANGO_SETTINGS_MODULE=network_inventory.settings.local; \
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
</tr>
|
</tr>
|
||||||
{% for customer in customer_list %}
|
{% for customer in customer_list %}
|
||||||
<tr>
|
<tr>
|
||||||
<td><a href="{% url 'computers' customer.id %}">{{ customer.name }}</a></td>
|
<td><a href="{% url 'lists' customer.id %}">{{ customer.name }}</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</table>
|
</table>
|
||||||
|
|
|
@ -10,4 +10,6 @@ urlpatterns = [
|
||||||
path('computer/<int:computer_id>/', views.computer_details,
|
path('computer/<int:computer_id>/', views.computer_details,
|
||||||
name='computer'),
|
name='computer'),
|
||||||
path('devices/', views.DeviceList.as_view(), name='devices'),
|
path('devices/', views.DeviceList.as_view(), name='devices'),
|
||||||
|
path('customer/<int:customer_id>/lists/', views.list_of_lists,
|
||||||
|
name='lists'),
|
||||||
]
|
]
|
||||||
|
|
|
@ -28,6 +28,10 @@ def computer_details(request, computer_id):
|
||||||
'cpu_list': cpu_list})
|
'cpu_list': cpu_list})
|
||||||
|
|
||||||
|
|
||||||
|
def list_of_lists(request, customer_id):
|
||||||
|
return render(request, 'inventory/list_of_lists.html')
|
||||||
|
|
||||||
|
|
||||||
class CustomerList(ListView):
|
class CustomerList(ListView):
|
||||||
model = Customer
|
model = Customer
|
||||||
template_name = 'inventory/customer_list.html'
|
template_name = 'inventory/customer_list.html'
|
||||||
|
|
Loading…
Reference in New Issue