<commit_before>from django.db.models.fields import FieldDoesNotExist
from django.db.models.fields.related import ForeignObjectRel
from django.db.models.fields.related import OneToOneRel

from django_filters import FilterSet
from django_filters import NumberFilter
from django_filters import DateFilter
from django_filters import DateTimeFilter
from django_filters import BooleanFilter
from django_filters import TypedChoiceFilter
from django_filters import CharFilter

from distutils.util import strtobool

from api.generics.filters import CommaSeparatedCharFilter
from api.generics.filters import CommaSeparatedStickyCharFilter
from api.generics.filters import TogetherFilterSet
from api.generics.filters import ToManyFilter
from api.generics.filters import ToManyNotInFilter

from rest_framework import filters
from django.db.models import Q, F

from iati.models import *
from iati.transaction.models import *
from iati_synchroniser.models import Dataset, Publisher

from django.contrib.postgres.search import SearchQuery


class ActivityFilter(TogetherFilterSet):

    activity_id = CommaSeparatedCharFilter(
        name='id',
        lookup_expr='in')

    iati_identifier = CommaSeparatedCharFilter(
        name='iati_identifier',
        lookup_expr='in')

    activity_scope = CommaSeparatedCharFilter(
        name='scope__code',
        lookup_expr='in',)

    document_link_category = ToManyFilter(
        qs=DocumentLink,
        lookup_expr='in',
        name='categories',
        fk='activity',
    )

    last_updated_model_lte = DateTimeFilter(
        lookup_expr='lt',
        name='last_updated_model'
    )

    planned_start_date_lte = DateFilter(
        lookup_expr='lte',
        name='planned_start')

    planned_start_date_gte = DateFilter(
        lookup_expr='gte',
        name='planned_start')

    actual_start_date_lte = DateFilter(
        lookup_expr='lte',
        name='actual_start')

    actual_start_date_gte = DateFilter(
        lookup_expr='gte',
        name='actual_start')

    planned_end_date_lte = DateFilter(
        lookup_expr='lte',
        name='planned_end')

    planned_end_date_gte = DateFilter(
        lookup_expr='gte',
        name='planned_end')

    actual_end_date_lte = DateFilter(
        lookup_expr='lte',<commit_msg>implement last_updated_datetime filter instead of last_updated_model filter<commit_after>from django.db.models.fields import FieldDoesNotExist
from django.db.models.fields.related import ForeignObjectRel
from django.db.models.fields.related import OneToOneRel

from django_filters import FilterSet
from django_filters import NumberFilter
from django_filters import DateFilter
from django_filters import DateTimeFilter
from django_filters import BooleanFilter
from django_filters import TypedChoiceFilter
from django_filters import CharFilter

from distutils.util import strtobool

from api.generics.filters import CommaSeparatedCharFilter
from api.generics.filters import CommaSeparatedStickyCharFilter
from api.generics.filters import TogetherFilterSet
from api.generics.filters import ToManyFilter
from api.generics.filters import ToManyNotInFilter

from rest_framework import filters
from django.db.models import Q, F

from iati.models import *
from iati.transaction.models import *
from iati_synchroniser.models import Dataset, Publisher

from django.contrib.postgres.search import SearchQuery


class ActivityFilter(TogetherFilterSet):

    activity_id = CommaSeparatedCharFilter(
        name='id',
        lookup_expr='in')

    iati_identifier = CommaSeparatedCharFilter(
        name='iati_identifier',
        lookup_expr='in')

    activity_scope = CommaSeparatedCharFilter(
        name='scope__code',
        lookup_expr='in',)

    document_link_category = ToManyFilter(
        qs=DocumentLink,
        lookup_expr='in',
        name='categories',
        fk='activity',
    )

    last_updated_datetime_lt = DateTimeFilter(
        lookup_expr='lt',
        name='last_updated_datetime'
    )

    planned_start_date_lte = DateFilter(
        lookup_expr='lte',
        name='planned_start')

    planned_start_date_gte = DateFilter(
        lookup_expr='gte',
        name='planned_start')

    actual_start_date_lte = DateFilter(
        lookup_expr='lte',
        name='actual_start')

    actual_start_date_gte = DateFilter(
        lookup_expr='gte',
        name='actual_start')

    planned_end_date_lte = DateFilter(
        lookup_expr='lte',
        name='planned_end')

    planned_end_date_gte = DateFilter(
        lookup_expr='gte',
        name='planned_end')

    actual_end_date_lte = DateFilter(
        lookup_expr='lte',
{'fraction_non_alphanumeric': 0.07104413347685684, 'fraction_numerical': 0.0, 'mean_word_length': 4.001076426264801, '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': '3598980', 'n_tokens_mistral': 1339, 'n_tokens_neox': 1312, 'n_words': 283}