<commit_before>from django.views.generic import TemplateView

from chickpea.models import Map


class Home(TemplateView):
    template_name = "youmap/home.html"
    list_template_name = "chickpea/map_list.html"

    def get_context_data(self, **kwargs):
        maps = Map.objects.all()[:20]
        return {
            "maps": maps
        }

    def get_template_names(self):
        """
        Dispatch template according to the kind of request: ajax or normal.
        """
        if self.request.is_ajax():
            return [self.list_template_name]
        else:
            return [self.template_name]

home = Home.as_view()
<commit_msg>Display more map in home, now that we have endless pagination<commit_after>from django.views.generic import TemplateView

from chickpea.models import Map


class Home(TemplateView):
    template_name = "youmap/home.html"
    list_template_name = "chickpea/map_list.html"

    def get_context_data(self, **kwargs):
        maps = Map.objects.all()[:100]
        return {
            "maps": maps
        }

    def get_template_names(self):
        """
        Dispatch template according to the kind of request: ajax or normal.
        """
        if self.request.is_ajax():
            return [self.list_template_name]
        else:
            return [self.template_name]

home = Home.as_view()

{'fraction_non_alphanumeric': 0.09739776951672863, 'fraction_numerical': 0.0037174721189591076, 'mean_word_length': 2.4601542416452444, 'pattern_counts': {'":': 2, '<': 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': '5648223', 'n_tokens_mistral': 404, 'n_tokens_neox': 390, 'n_words': 98}