Commit e2fa6632 authored by dani2612's avatar dani2612

Aggiunta alla view list delle things la table che conterrà gli oggetti

aggiunto un nuovo template destinato all'inserimento delle categorie
parent 79ce1aef
{% extends 'main.html' %}
\ No newline at end of file
{% 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 %}
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
......@@ -46,3 +48,4 @@ class ThingView(View):
class ThingListView(generic.ListView):
model = Thing
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment