<commit_before>from django.views.generic import CreateView, DetailView, UpdateView, DeleteView
from django.utils.translation import ugettext_lazy as _
from braces.views import (SelectRelatedMixin, LoginRequiredMixin, FormValidMessageMixin,
                          UserFormKwargsMixin)
from django.core.urlresolvers import reverse_lazy
from django_filters.views import FilterView
from atom.views import DeleteMessageMixin, FormInitialMixin
from .models import Case
from .forms import CaseForm, NewCaseForm
from .filters import CaseFilter
from foundation.letters.models import Letter


class CaseListView(SelectRelatedMixin, FilterView):
    filterset_class = CaseFilter
    model = Case
    select_related = ['created_by', 'office']
    paginate_by = 25
<commit_msg>Fix query flood in CaseListView<commit_after>from django.views.generic import CreateView, DetailView, UpdateView, DeleteView
from django.utils.translation import ugettext_lazy as _
from braces.views import (SelectRelatedMixin, LoginRequiredMixin, FormValidMessageMixin,
                          UserFormKwargsMixin)
from django.core.urlresolvers import reverse_lazy
from django_filters.views import FilterView
from atom.views import DeleteMessageMixin, FormInitialMixin
from .models import Case
from .forms import CaseForm, NewCaseForm
from .filters import CaseFilter
from foundation.letters.models import Letter


class CaseListView(SelectRelatedMixin, FilterView):
    filterset_class = CaseFilter
    model = Case
    select_related = ['created_by', 'office', 'office__jst']
    paginate_by = 25

{'fraction_non_alphanumeric': 0.05552010210593491, 'fraction_numerical': 0.0025526483726866626, 'mean_word_length': 5.173228346456693, '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': '3068683', 'n_tokens_mistral': 434, 'n_tokens_neox': 415, 'n_words': 127}