Commit e2fa6632 authored by dani2612's avatar dani2612
Browse files

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

aggiunto un nuovo template destinato all'inserimento delle categorie
parent 79ce1aef
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
{% extends 'main.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 %}
+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
    
    
 
@@ -46,3 +48,4 @@ class ThingView(View):

class ThingListView(generic.ListView):
    model = Thing