Loading things/templates/things/category_list.html 0 → 100644 +2 −0 Original line number Diff line number Diff line {% extends 'main.html' %} things/templates/things/thing_list.html +46 −1 Original line number Diff line number Diff line {% extends 'main.html' %} {% load bootstrap3 %} {% block content %} <table class="table table-dark"> <thead> <tr> <th scope="col">Id</th> <th scope="col">Name</th> <th scope="col">Description</th> <th scope="col">Categories</th> <th scope="col">Quantity</th> <th scope="col">Consumable</th> <th scope="col">Borrowable</th> <th scope="col">Location</th> </tr> </thead> <tbody> {% for obj in thing %} <tr> <td >{{ obj.id }}</td> <td >{{ obj.name }}</td> <td >{{ obj.description }}</td> <td >{{ obj.categories }}</td> <td >{{ obj.quantity }}</td> <td >{{ obj.consumable }}</td> <td >{{ obj.borrowable }}</td> <td>{{ obj.location }}</td> </tr> {% endfor %} </tbody> {% endblock %} things/views.py +5 −2 Original line number Diff line number Diff line from django.shortcuts import get_object_or_404, render from django.views import View, generic from django import forms from .models import Thing from .models import Thing,Category class CategoryListView(generic.ListView): model = Category Loading Loading @@ -46,3 +48,4 @@ class ThingView(View): class ThingListView(generic.ListView): model = Thing Loading
things/templates/things/category_list.html 0 → 100644 +2 −0 Original line number Diff line number Diff line {% extends 'main.html' %}
things/templates/things/thing_list.html +46 −1 Original line number Diff line number Diff line {% extends 'main.html' %} {% load bootstrap3 %} {% block content %} <table class="table table-dark"> <thead> <tr> <th scope="col">Id</th> <th scope="col">Name</th> <th scope="col">Description</th> <th scope="col">Categories</th> <th scope="col">Quantity</th> <th scope="col">Consumable</th> <th scope="col">Borrowable</th> <th scope="col">Location</th> </tr> </thead> <tbody> {% for obj in thing %} <tr> <td >{{ obj.id }}</td> <td >{{ obj.name }}</td> <td >{{ obj.description }}</td> <td >{{ obj.categories }}</td> <td >{{ obj.quantity }}</td> <td >{{ obj.consumable }}</td> <td >{{ obj.borrowable }}</td> <td>{{ obj.location }}</td> </tr> {% endfor %} </tbody> {% endblock %}
things/views.py +5 −2 Original line number Diff line number Diff line from django.shortcuts import get_object_or_404, render from django.views import View, generic from django import forms from .models import Thing from .models import Thing,Category class CategoryListView(generic.ListView): model = Category Loading Loading @@ -46,3 +48,4 @@ class ThingView(View): class ThingListView(generic.ListView): model = Thing