Trying to put django table into dashboard.html page. I can visualize my table in another html file but cant fix how to put inside the dashboard page
models.py
class Asset(models.Model): type = models.ForeignKey(AssetType, on_delete=models.CASCADE) lc_phase = models.ForeignKey("Asset_Life_Cycle.LifeCyclePhase", on_delete=models.CASCADE) name = models.CharField(max_length=30) # BaseSpatialField.srid() geom = models.GeometryField()
views.py
from .models import Asset import django_tables2 as tables class AssetTable(tables.Table): class Meta : model = Asset class AssetTableView(tables.SingleTableView): queryset = Asset.objects.all() table_class = AssetTable template_name = 'deneme.html'
Tried this but didnt work
https://stackoverflow.com/questions/67238701/using-django-tables2-in-dashbord April 24, 2021 at 10:04AM
没有评论:
发表评论