#django-tables2 NOT cbv (solved)

2 messages · Page 1 of 1 (latest)

umbral quartz
#

Is there a way to use this application without Class Based View ?

def Test(request):
    table = TradeTable(TestModel.objects.all())
    return render(request, "my_app/test.html", {"table": table})

display the table, the clickable header for sortering, but sortering does not work. No error (django console, chrome devtool).

umbral quartz
#
def Test(request):
    table = TradeTable(Trade.objects.all())
    RequestConfig(request).configure(table)
    return render(request, "journal/test.html", {"table": table})

need to add RequestConfig, I find it reading code on this blog https://medium.com/@ezequiel.grondona/row-actions-with-django-tables2-and-materializecss-3e4618544db0

Medium

Django-tables2 and materializecss integration was not as “plug and play” as I expected. The purpose of this story is to share some tips tha