<commit_before>import django_filters
from django.utils.translation import ugettext_lazy as _

from adhocracy4.filters import widgets as filters_widgets
from adhocracy4.filters.filters import DefaultsFilterSet
from adhocracy4.filters.filters import FreeTextFilter
from adhocracy4.projects.models import Project
from meinberlin.apps.projects import views


class FreeTextFilterWidget(filters_widgets.FreeTextFilterWidget):
    label = _('Search')


class DashboardProjectFilterSet(DefaultsFilterSet):

    defaults = {
        'is_archived': 'false'
    }

    ordering = django_filters.OrderingFilter(
        choices=(
            ('-created', _('Most recent')),
        ),
        empty_label=None,
        widget=views.OrderingWidget,
    )

    search = FreeTextFilter(
        widget=FreeTextFilterWidget,
        fields=['name']
    )

    is_archived = django_filters.BooleanFilter(
        widget=views.ArchivedWidget
    )

    created = django_filters.NumberFilter(
        name='created',
        lookup_expr='year',
        widget=views.YearWidget,
    )

    typ = django_filters.CharFilter(
        widget=views.TypeWidget,
    )

    class Meta:
        model = Project
        fields = ['search', 'is_archived', 'created', 'typ']
<commit_msg>Remove typ filter from dashboard<commit_after>import django_filters
from django.utils.translation import ugettext_lazy as _

from adhocracy4.filters import widgets as filters_widgets
from adhocracy4.filters.filters import DefaultsFilterSet
from adhocracy4.filters.filters import FreeTextFilter
from adhocracy4.projects.models import Project
from meinberlin.apps.projects import views


class FreeTextFilterWidget(filters_widgets.FreeTextFilterWidget):
    label = _('Search')


class DashboardProjectFilterSet(DefaultsFilterSet):

    defaults = {
        'is_archived': 'false'
    }

    ordering = django_filters.OrderingFilter(
        choices=(
            ('-created', _('Most recent')),
        ),
        empty_label=None,
        widget=views.OrderingWidget,
    )

    search = FreeTextFilter(
        widget=FreeTextFilterWidget,
        fields=['name']
    )

    is_archived = django_filters.BooleanFilter(
        widget=views.ArchivedWidget
    )

    created = django_filters.NumberFilter(
        name='created',
        lookup_expr='year',
        widget=views.YearWidget,
    )

    class Meta:
        model = Project
        fields = ['search', 'is_archived', 'created']

{'fraction_non_alphanumeric': 0.08738260514495713, 'fraction_numerical': 0.0032666394446712946, 'mean_word_length': 3.209621993127148, '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': '6526379', 'n_tokens_mistral': 709, 'n_tokens_neox': 678, 'n_words': 140}