<commit_before>import django_filters

from nodeconductor.core.filters import UUIDFilter

from . import models


class PackageTemplateFilter(django_filters.FilterSet):
    name = django_filters.CharFilter(lookup_type='icontains')
    settings_uuid = UUIDFilter(name='service_settings__uuid')

    class Meta(object):
        model = models.PackageTemplate
        fields = ('name', 'settings_uuid',)


class OpenStackPackageFilter(django_filters.FilterSet):
    name = django_filters.CharFilter(lookup_type='icontains')
    customer = UUIDFilter(name='tenant__service_project_link__project__customer')
    project = UUIDFilter(name='tenant__service_project_link__project')

    class Meta(object):
        model = models.OpenStackPackage
        fields = ('name', 'customer', 'project')<commit_msg>Enable filtering OpenStack package by tenant.<commit_after>import django_filters

from nodeconductor.core.filters import UUIDFilter

from . import models


class PackageTemplateFilter(django_filters.FilterSet):
    name = django_filters.CharFilter(lookup_type='icontains')
    settings_uuid = UUIDFilter(name='service_settings__uuid')

    class Meta(object):
        model = models.PackageTemplate
        fields = ('name', 'settings_uuid',)


class OpenStackPackageFilter(django_filters.FilterSet):
    name = django_filters.CharFilter(lookup_type='icontains')
    customer = UUIDFilter(name='tenant__service_project_link__project__customer__uuid')
    project = UUIDFilter(name='tenant__service_project_link__project__uuid')
    tenant = UUIDFilter(name='tenant__uuid')

    class Meta(object):
        model = models.OpenStackPackage
        fields = ('name', 'customer', 'project', 'tenant')
{'fraction_non_alphanumeric': 0.09568812758417011, 'fraction_numerical': 0.0, 'mean_word_length': 5.44106463878327, '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': '6982824', 'n_tokens_mistral': 471, 'n_tokens_neox': 464, 'n_words': 83}