<commit_before>from tastypie_nonrel.resources import MongoResource
from tastypie_nonrel.fields import ForeignKeysListField
from tastypie.constants import ALL
from tastypie import fields
from models import (Deputy, Document, Commission, WrittenQuestion,
                    CommissionMembership, AnnualReport, Party)


class AnnualReportRessource(MongoResource):
    class Meta:
        queryset = AnnualReport.objects.all()
        resource_name = 'annual-report'


class PartyResource(MongoResource):
    class Meta:
        queryset = Party.objects.all()


class DeputyResource(MongoResource):
    party = fields.ForeignKey(PartyResource, 'party')

    class Meta:
        queryset = Deputy.objects.all()
        filtering = {
            "lachambre_id": ALL,
        }
<commit_msg>[fix] make party nullable in api<commit_after>from tastypie_nonrel.resources import MongoResource
from tastypie_nonrel.fields import ForeignKeysListField
from tastypie.constants import ALL
from tastypie import fields
from models import (Deputy, Document, Commission, WrittenQuestion,
                    CommissionMembership, AnnualReport, Party)


class AnnualReportRessource(MongoResource):
    class Meta:
        queryset = AnnualReport.objects.all()
        resource_name = 'annual-report'


class PartyResource(MongoResource):
    class Meta:
        queryset = Party.objects.all()


class DeputyResource(MongoResource):
    party = fields.ForeignKey(PartyResource, 'party', null=True)

    class Meta:
        queryset = Deputy.objects.all()
        filtering = {
            "lachambre_id": ALL,
        }

{'fraction_non_alphanumeric': 0.07634543178973717, 'fraction_numerical': 0.0, 'mean_word_length': 3.5042253521126763, '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': '5475811', 'n_tokens_mistral': 445, 'n_tokens_neox': 429, 'n_words': 110}