<commit_before>from rest_framework_datatables.pagination import DatatablesPageNumberPagination


class MapentityDatatablePagination(DatatablesPageNumberPagination):
    """ Custom datatable pagination for Mapentity list views. """

    def get_count_and_total_count(self, queryset, view):
        """ Handle count for all filters """
        count, total_count = super().get_count_and_total_count(queryset, view)
        count = queryset.count()  # replace count by real count - not only drf-datatables count
        return count, total_count<commit_msg>fix pagination count<commit_after>from rest_framework_datatables.pagination import DatatablesPageNumberPagination


class MapentityDatatablePagination(DatatablesPageNumberPagination):
    """ Custom datatable pagination for Mapentity list views. """

    def get_count_and_total_count(self, queryset, view):
        """ Handle count for all filters """
        count = queryset.count()  # replace count by real count - not only drf-datatables count
        if hasattr(view, '_datatables_total_count'):
            total_count = view._datatables_total_count
            del view._datatables_total_count
        else:  # pragma: no cover
            total_count = count
        return count, total_count
{'fraction_non_alphanumeric': 0.06932270916334661, 'fraction_numerical': 0.0, 'mean_word_length': 3.9448818897637796, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7451439', 'n_tokens_mistral': 341, 'n_tokens_neox': 342, 'n_words': 90}