You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to visualize a big, indexed table - big enough for count(*) to be too slow for my use case. Here's my views.py code:
import django_tables2
from projectname.models import Growth
def dashboard(request):
class StatisticsTable(django_tables2.Table):
class Meta:
model = Growth
table = StatisticsTable(Growth.objects.all())
django_tables2.RequestConfig(
request
).configure(table)
return render(request, "plain_table.html", {'table': table,
'title': 'Growth dashboard',
'search': None})
I was looking for examples on how to use django_tables2.paginators.LazyPaginator here and so far only found that I should pass it as a paginate= in django_tables2.RequestConfig, but I still get a regular paginator if I pass a reference to the class there. What's the proper use of this class in this context?
The text was updated successfully, but these errors were encountered:
This is a copy of this SO question: https://stackoverflow.com/q/53208617/1091116
I want to visualize a big, indexed table - big enough for
count(*)
to be too slow for my use case. Here's my views.py code:I was looking for examples on how to use
django_tables2.paginators.LazyPaginator
here and so far only found that I should pass it as apaginate=
indjango_tables2.RequestConfig
, but I still get a regular paginator if I pass a reference to the class there. What's the proper use of this class in this context?The text was updated successfully, but these errors were encountered: