django-material icon indicating copy to clipboard operation
django-material copied to clipboard

if statement fetch all rows, slowdown

Open rasulovmuxtor opened this issue 3 years ago • 1 comments

material.frontend.views.list.DataTableMixin.get_data_attr line 220

please change to something like this: if hasattr(self, 'object_list') and self.object_list is not None:

https://github.com/viewflow/django-material/blob/615913ea86db35e56e518a772d317dc44f392f2b/material/frontend/views/list.py#L220

https://docs.djangoproject.com/en/4.0/ref/models/querysets/#when-querysets-are-evaluated

rasulovmuxtor avatar Feb 17 '22 10:02 rasulovmuxtor

Thank you for good point! I wasn't able to spot the problem

Seems this fixes it? https://github.com/viewflow/django-material/commit/55561ac10e40c5e21bbc7fc42dba77a13b20384e

kmmbvnr avatar Mar 01 '22 13:03 kmmbvnr