<pre>models.py class Reagentquant(models.Model): Name_Of_Reagent= models.TextField() Reagent_Quantity= models.TextField() tables.py class ReagentquantTable(tables.Table): class Meta: model = Reagentquant template_name = 'django_tables2/bootstrap4.html' views.py def reagentquant(request): table = ReagentquantTable(Reagentquant.objects.all()) RequestConfig(request).configure(table) return render(request, 'inventory/quant.html', {'table': table}) template {% load render_table from django_tables2 %} <!doctype html> <html> <head> <title>Inventory Tracker</title> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" /> </head> <body> {% render_table table %} </body> </html>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)