<commit_before>from tastypie import fields
from tastypie.resources import ModelResource
from meps.models import Country,\
                        LocalParty,\
                        Group,\
                        Delegation,\
                        Committee,\
                        Building,\
                        Organization,\
                        MEP,\
                        GroupMEP,\
                        DelegationRole,\
                        CommitteeRole,\
                        PostalAddress,\
                        CountryMEP,\
                        OrganizationMEP


class MEPCountryResource(ModelResource):
    class Meta:
        queryset = Country.objects.all()


class MEPLocalPartyResource(ModelResource):
    country = fields.ForeignKey(MEPCountryResource, "country")

    class Meta:
        queryset = LocalParty.objects.all()


class MEPGroupResource(ModelResource):
    class Meta:
        queryset = Group.objects.all()


class MEPDelegationResource(ModelResource):
    class Meta:
        queryset = Delegation.objects.all()


class MEPCommitteeResource(ModelResource):
    class Meta:
        queryset = Committee.objects.all()


class MEPBuildingResource(ModelResource):
    class Meta:
        queryset = Building.objects.all()


class MEPOrganizationResource(ModelResource):
    class Meta:
        queryset = Organization.objects.all()


class MEPMEPResource(ModelResource):
    bxl_building = fields.ForeignKey(MEPBuildingResource, "bxl_building")
    stg_building = fields.ForeignKey(MEPBuildingResource, "stg_building")

    class Meta:
        queryset = MEP.objects.all()


class MEPGroupMEPResource(ModelResource):
    group = fields.ForeignKey(MEPGroupResource, "group")
    mep = fields.ForeignKey(MEPMEPResource, "mep")

    class Meta:
        queryset = GroupMEP.objects.all()


class MEPDelegationRoleResource(ModelResource):
    mep = fields.ForeignKey(MEPMEPResource, "mep")
    delegation = fields.ForeignKey(MEPDelegationResource, "delegation")

    class Meta:
        queryset = DelegationRole.objects.all()


class MEPCommitteeRoleResource(ModelResource):
    class Meta:
        queryset = CommitteeRole.objects.all()


class MEPPostalAddressResource(ModelResource):
    class Meta:
        queryset = PostalAddress.objects.all()


class MEPCountryMEPResource(ModelResource):
    class Meta:
        queryset = CountryMEP.objects.all()


class MEPOrganizationMEPResource(ModelResource):
    class Meta:
        queryset = OrganizationMEP.objects.all()<commit_msg>[enh] link committeerole and mep in api<commit_after>from tastypie import fields
from tastypie.resources import ModelResource
from meps.models import Country,\
                        LocalParty,\
                        Group,\
                        Delegation,\
                        Committee,\
                        Building,\
                        Organization,\
                        MEP,\
                        GroupMEP,\
                        DelegationRole,\
                        CommitteeRole,\
                        PostalAddress,\
                        CountryMEP,\
                        OrganizationMEP


class MEPCountryResource(ModelResource):
    class Meta:
        queryset = Country.objects.all()


class MEPLocalPartyResource(ModelResource):
    country = fields.ForeignKey(MEPCountryResource, "country")

    class Meta:
        queryset = LocalParty.objects.all()


class MEPGroupResource(ModelResource):
    class Meta:
        queryset = Group.objects.all()


class MEPDelegationResource(ModelResource):
    class Meta:
        queryset = Delegation.objects.all()


class MEPCommitteeResource(ModelResource):
    class Meta:
        queryset = Committee.objects.all()


class MEPBuildingResource(ModelResource):
    class Meta:
        queryset = Building.objects.all()


class MEPOrganizationResource(ModelResource):
    class Meta:
        queryset = Organization.objects.all()


class MEPMEPResource(ModelResource):
    bxl_building = fields.ForeignKey(MEPBuildingResource, "bxl_building")
    stg_building = fields.ForeignKey(MEPBuildingResource, "stg_building")

    class Meta:
        queryset = MEP.objects.all()


class MEPGroupMEPResource(ModelResource):
    group = fields.ForeignKey(MEPGroupResource, "group")
    mep = fields.ForeignKey(MEPMEPResource, "mep")

    class Meta:
        queryset = GroupMEP.objects.all()


class MEPDelegationRoleResource(ModelResource):
    mep = fields.ForeignKey(MEPMEPResource, "mep")
    delegation = fields.ForeignKey(MEPDelegationResource, "delegation")

    class Meta:
        queryset = DelegationRole.objects.all()


class MEPCommitteeRoleResource(ModelResource):
    mep = fields.ForeignKey(MEPMEPResource, "mep")
    committee = fields.ForeignKey(MEPCommitteeResource, "committee")

    class Meta:
        queryset = CommitteeRole.objects.all()


class MEPPostalAddressResource(ModelResource):
    class Meta:
        queryset = PostalAddress.objects.all()


class MEPCountryMEPResource(ModelResource):
    class Meta:
        queryset = CountryMEP.objects.all()


class MEPOrganizationMEPResource(ModelResource):
    class Meta:
        queryset = OrganizationMEP.objects.all()
{'fraction_non_alphanumeric': 0.08200804751868174, 'fraction_numerical': 0.0, 'mean_word_length': 2.4661354581673307, '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': '1150859', 'n_tokens_mistral': 1437, 'n_tokens_neox': 1375, 'n_words': 271}