from django import forms
from django.contrib.auth.models import User
from django.contrib.contenttypes.models import ContentType
from django.utils.translation import gettext as _

from dcim.models import DeviceRole, DeviceType, Platform, Region, Site, SiteGroup
from extras.choices import *
from extras.models import *
from extras.utils import FeatureQuery
from netbox.forms.base import NetBoxModelFilterSetForm
from tenancy.models import Tenant, TenantGroup
from utilities.forms import (
    add_blank_choice, APISelectMultiple, BOOLEAN_WITH_BLANK_CHOICES, ContentTypeChoiceField,
    ContentTypeMultipleChoiceField, DateTimePicker, DynamicModelMultipleChoiceField, FilterForm, MultipleChoiceField,
    StaticSelect, TagFilterField,
)
from virtualization.models import Cluster, ClusterGroup, ClusterType

__all__ = (
    'ConfigContextFilterForm',
    'CustomFieldFilterForm',
    'CustomLinkFilterForm',
    'ExportTemplateFilterForm',
    'JournalEntryFilterForm',
    'LocalConfigContextFilterForm',
    'ObjectChangeFilterForm',
    'TagFilterForm',
    'WebhookFilterForm',
)


class CustomFieldFilterForm(FilterForm):
    fieldsets = (
        (None, ('q',)),
        ('Attributes', ('type', 'content_types', 'weight', 'required')),
    )
    content_types = ContentTypeMultipleChoiceField(
        queryset=ContentType.objects.all(),
        limit_choices_to=FeatureQuery('custom_fields'),
        required=False
    )
    type = MultipleChoiceField(
        choices=CustomFieldTypeChoices,
        required=False,
        label=_('Field type')
    )
    weight = forms.IntegerField(
        required=False
    )
    required = forms.NullBooleanField(
        required=False,
        widget=StaticSelect(
            choices=BOOLEAN_WITH_BLANK_CHOICES
        )
    )


class CustomLinkFilterForm(FilterForm):
    fieldsets = (
        (None, ('q',)),
        ('Attributes', ('content_type', 'enabled', 'new_window', 'weight')),
    )
    content_type = ContentTypeChoiceField(
        queryset=ContentType.objects.all(),
        limit_choices_to=FeatureQuery('custom_links'),
        required=False
    )
    enabled = forms.NullBooleanField(
        required=False,
        widget=StaticSelect(
            choices=BOOLEAN_WITH_BLANK_CHOICES
        )
    )
    new_window = forms.NullBooleanField(
        required=False,
        widget=StaticSelect(
            choices=BOOLEAN_WITH_BLANK_CHOICES
        )
    )
    weight = forms.IntegerField(
        required=False
    )


class ExportTemplateFilterForm(FilterForm):
    fieldsets = (
        (None, ('q',)),
        ('Attributes', ('content_type', 'mime_type', 'file_extension', 'as_attachment')),
    )
    content_type = ContentTypeChoiceField(
        queryset=ContentType.objects.all(),
        limit_choices_to=FeatureQuery('export_templates'),
        required=False
    )
    mime_type = forms.CharField(
        required=False,
        label=_('MIME type')
    )
    file_extension = forms.CharField(
        required=False
    )
    as_attachment = forms.NullBooleanField(
        required=False,
        widget=StaticSelect(
            choices=BOOLEAN_WITH_BLANK_CHOICES
        )
    )


class WebhookFilterForm(FilterForm):
    fieldsets = (
        (None, ('q',)),
        ('Attributes', ('content_types', 'http_method', 'enabled')),
        ('Events', ('type_create', 'type_update', 'type_delete')),
    )
    content_types = ContentTypeMultipleChoiceField(
        queryset=ContentType.objects.all(),
        limit_choices_to=FeatureQuery('webhooks'),
        required=False
    )
    http_method = MultipleChoiceField(
        choices=WebhookHttpMethodChoices,
        required=False,
        label=_('HTTP method')
    )
    enabled = forms.NullBooleanField(
        required=False,
        widget=StaticSelect(
            choices=BOOLEAN_WITH_BLANK_CHOICES
        )
    )
    type_create = forms.NullBooleanField(
        required=False,
        widget=StaticSelect(
            choices=BOOLEAN_WITH_BLANK_CHOICES
        )
    )
    type_update = forms.NullBooleanField(
        required=False,
        widget=StaticSelect(
            choices=BOOLEAN_WITH_BLANK_CHOICES
        )
    )
    type_delete = forms.NullBooleanField(
        required=False,
        widget=StaticSelect(
            choices=BOOLEAN_WITH_BLANK_CHOICES
        )
    )


class TagFilterForm(FilterForm):
    model = Tag
    content_type_id = ContentTypeMultipleChoiceField(
        queryset=ContentType.objects.filter(FeatureQuery('tags').get_query()),
        required=False,
        label=_('Tagged object type')
    )


class ConfigContextFilterForm(FilterForm):
    fieldsets = (
        (None, ('q', 'tag_id')),
        ('Location', ('region_id', 'site_group_id', 'site_id')),
        ('Device', ('device_type_id', 'platform_id', 'role_id')),
        ('Cluster', ('cluster_type_id', 'cluster_group_id', 'cluster_id')),
        ('Tenant', ('tenant_group_id', 'tenant_id'))
    )
    region_id = DynamicModelMultipleChoiceField(
        queryset=Region.objects.all(),
        required=False,
        label=_('Regions')
    )
    site_group_id = DynamicModelMultipleChoiceField(
        queryset=SiteGroup.objects.all(),
        required=False,
        label=_('Site groups')
    )
    site_id = DynamicModelMultipleChoiceField(
        queryset=Site.objects.all(),
        required=False,
        label=_('Sites')
    )
    device_type_id = DynamicModelMultipleChoiceField(
        queryset=DeviceType.objects.all(),
        required=False,
        label=_('Device types')
    )
    role_id = DynamicModelMultipleChoiceField(
        queryset=DeviceRole.objects.all(),
        required=False,
        label=_('Roles')
    )
    platform_id = DynamicModelMultipleChoiceField(
        queryset=Platform.objects.all(),
        required=False,
        label=_('Platforms')
    )
    cluster_type_id = DynamicModelMultipleChoiceField(
        queryset=ClusterType.objects.all(),
        required=False,
        label=_('Cluster types'),
        fetch_trigger='open'
    )
    cluster_group_id = DynamicModelMultipleChoiceField(
        queryset=ClusterGroup.objects.all(),
        required=False,
        label=_('Cluster groups')
    )
    cluster_id = DynamicModelMultipleChoiceField(
        queryset=Cluster.objects.all(),
        required=False,
        label=_('Clusters')
    )
    tenant_group_id = DynamicModelMultipleChoiceField(
        queryset=TenantGroup.objects.all(),
        required=False,
        label=_('Tenant groups')
    )
    tenant_id = DynamicModelMultipleChoiceField(
        queryset=Tenant.objects.all(),
        required=False,
        label=_('Tenant')
    )
    tag_id = DynamicModelMultipleChoiceField(
        queryset=Tag.objects.all(),
        required=False,
        label=_('Tags')
    )


class LocalConfigContextFilterForm(forms.Form):
    local_context_data = forms.NullBooleanField(
        required=False,
        label=_('Has local config context data'),
        widget=StaticSelect(
            choices=BOOLEAN_WITH_BLANK_CHOICES
        )
    )


class JournalEntryFilterForm(NetBoxModelFilterSetForm):
    model = JournalEntry
    fieldsets = (
        (None, ('q', 'tag')),
        ('Creation', ('created_before', 'created_after', 'created_by_id')),
        ('Attributes', ('assigned_object_type_id', 'kind'))
    )
    created_after = forms.DateTimeField(
        required=False,
        label=_('After'),
        widget=DateTimePicker()
    )
    created_before = forms.DateTimeField(
        required=False,
        label=_('Before'),
        widget=DateTimePicker()
    )
    created_by_id = DynamicModelMultipleChoiceField(
        queryset=User.objects.all(),
        required=False,
        label=_('User'),
        widget=APISelectMultiple(
            api_url='/api/users/users/',
        )
    )
    assigned_object_type_id = DynamicModelMultipleChoiceField(
        queryset=ContentType.objects.all(),
        required=False,
        label=_('Object Type'),
        widget=APISelectMultiple(
            api_url='/api/extras/content-types/',
        )
    )
    kind = forms.ChoiceField(
        choices=add_blank_choice(JournalEntryKindChoices),
        required=False,
        widget=StaticSelect()
    )
    tag = TagFilterField(model)


class ObjectChangeFilterForm(FilterForm):
    model = ObjectChange
    fieldsets = (
        (None, ('q',)),
        ('Time', ('time_before', 'time_after')),
        ('Attributes', ('action', 'user_id', 'changed_object_type_id')),
    )
    time_after = forms.DateTimeField(
        required=False,
        label=_('After'),
        widget=DateTimePicker()
    )
    time_before = forms.DateTimeField(
        required=False,
        label=_('Before'),
        widget=DateTimePicker()
    )
    action = forms.ChoiceField(
        choices=add_blank_choice(ObjectChangeActionChoices),
        required=False,
        widget=StaticSelect()
    )
    user_id = DynamicModelMultipleChoiceField(
        queryset=User.objects.all(),
        required=False,
        label=_('User'),
        widget=APISelectMultiple(
            api_url='/api/users/users/',
        )
    )
    changed_object_type_id = DynamicModelMultipleChoiceField(
        queryset=ContentType.objects.all(),
        required=False,
        label=_('Object Type'),
        widget=APISelectMultiple(
            api_url='/api/extras/content-types/',
        )
    )

[((47, 13, 49, 5), 'django.forms.IntegerField', 'forms.IntegerField', (), '', False, 'from django import forms\n'), ((80, 13, 82, 5), 'django.forms.IntegerField', 'forms.IntegerField', (), '', False, 'from django import forms\n'), ((99, 21, 101, 5), 'django.forms.CharField', 'forms.CharField', (), '', False, 'from django import forms\n'), ((280, 10, 280, 31), 'utilities.forms.TagFilterField', 'TagFilterField', ({(280, 25, 280, 30): 'model'}, {}), '(model)', False, 'from utilities.forms import add_blank_choice, APISelectMultiple, BOOLEAN_WITH_BLANK_CHOICES, ContentTypeChoiceField, ContentTypeMultipleChoiceField, DateTimePicker, DynamicModelMultipleChoiceField, FilterForm, MultipleChoiceField, StaticSelect, TagFilterField\n'), ((38, 17, 38, 42), 'django.contrib.contenttypes.models.ContentType.objects.all', 'ContentType.objects.all', ({}, {}), '()', False, 'from django.contrib.contenttypes.models import ContentType\n'), ((39, 25, 39, 54), 'extras.utils.FeatureQuery', 'FeatureQuery', ({(39, 38, 39, 53): '"""custom_fields"""'}, {}), "('custom_fields')", False, 'from extras.utils import FeatureQuery\n'), ((45, 14, 45, 29), 'django.utils.translation.gettext', '_', ({(45, 16, 45, 28): '"""Field type"""'}, {}), "('Field type')", True, 'from django.utils.translation import gettext as _\n'), ((52, 15, 54, 9), 'utilities.forms.StaticSelect', 'StaticSelect', (), '', False, 'from utilities.forms import add_blank_choice, APISelectMultiple, BOOLEAN_WITH_BLANK_CHOICES, ContentTypeChoiceField, ContentTypeMultipleChoiceField, DateTimePicker, DynamicModelMultipleChoiceField, FilterForm, MultipleChoiceField, StaticSelect, TagFilterField\n'), ((64, 17, 64, 42), 'django.contrib.contenttypes.models.ContentType.objects.all', 'ContentType.objects.all', ({}, {}), '()', False, 'from django.contrib.contenttypes.models import ContentType\n'), ((65, 25, 65, 53), 'extras.utils.FeatureQuery', 'FeatureQuery', ({(65, 38, 65, 52): '"""custom_links"""'}, {}), "('custom_links')", False, 'from extras.utils import FeatureQuery\n'), ((70, 15, 72, 9), 'utilities.forms.StaticSelect', 'StaticSelect', (), '', False, 'from utilities.forms import add_blank_choice, APISelectMultiple, BOOLEAN_WITH_BLANK_CHOICES, ContentTypeChoiceField, ContentTypeMultipleChoiceField, DateTimePicker, DynamicModelMultipleChoiceField, FilterForm, MultipleChoiceField, StaticSelect, TagFilterField\n'), ((76, 15, 78, 9), 'utilities.forms.StaticSelect', 'StaticSelect', (), '', False, 'from utilities.forms import add_blank_choice, APISelectMultiple, BOOLEAN_WITH_BLANK_CHOICES, ContentTypeChoiceField, ContentTypeMultipleChoiceField, DateTimePicker, DynamicModelMultipleChoiceField, FilterForm, MultipleChoiceField, StaticSelect, TagFilterField\n'), ((91, 17, 91, 42), 'django.contrib.contenttypes.models.ContentType.objects.all', 'ContentType.objects.all', ({}, {}), '()', False, 'from django.contrib.contenttypes.models import ContentType\n'), ((92, 25, 92, 57), 'extras.utils.FeatureQuery', 'FeatureQuery', ({(92, 38, 92, 56): '"""export_templates"""'}, {}), "('export_templates')", False, 'from extras.utils import FeatureQuery\n'), ((97, 14, 97, 28), 'django.utils.translation.gettext', '_', ({(97, 16, 97, 27): '"""MIME type"""'}, {}), "('MIME type')", True, 'from django.utils.translation import gettext as _\n'), ((104, 15, 106, 9), 'utilities.forms.StaticSelect', 'StaticSelect', (), '', False, 'from utilities.forms import add_blank_choice, APISelectMultiple, BOOLEAN_WITH_BLANK_CHOICES, ContentTypeChoiceField, ContentTypeMultipleChoiceField, DateTimePicker, DynamicModelMultipleChoiceField, FilterForm, MultipleChoiceField, StaticSelect, TagFilterField\n'), ((117, 17, 117, 42), 'django.contrib.contenttypes.models.ContentType.objects.all', 'ContentType.objects.all', ({}, {}), '()', False, 'from django.contrib.contenttypes.models import ContentType\n'), ((118, 25, 118, 49), 'extras.utils.FeatureQuery', 'FeatureQuery', ({(118, 38, 118, 48): '"""webhooks"""'}, {}), "('webhooks')", False, 'from extras.utils import FeatureQuery\n'), ((124, 14, 124, 30), 'django.utils.translation.gettext', '_', ({(124, 16, 124, 29): '"""HTTP method"""'}, {}), "('HTTP method')", True, 'from django.utils.translation import gettext as _\n'), ((128, 15, 130, 9), 'utilities.forms.StaticSelect', 'StaticSelect', (), '', False, 'from utilities.forms import add_blank_choice, APISelectMultiple, BOOLEAN_WITH_BLANK_CHOICES, ContentTypeChoiceField, ContentTypeMultipleChoiceField, DateTimePicker, DynamicModelMultipleChoiceField, FilterForm, MultipleChoiceField, StaticSelect, TagFilterField\n'), ((134, 15, 136, 9), 'utilities.forms.StaticSelect', 'StaticSelect', (), '', False, 'from utilities.forms import add_blank_choice, APISelectMultiple, BOOLEAN_WITH_BLANK_CHOICES, ContentTypeChoiceField, ContentTypeMultipleChoiceField, DateTimePicker, DynamicModelMultipleChoiceField, FilterForm, MultipleChoiceField, StaticSelect, TagFilterField\n'), ((140, 15, 142, 9), 'utilities.forms.StaticSelect', 'StaticSelect', (), '', False, 'from utilities.forms import add_blank_choice, APISelectMultiple, BOOLEAN_WITH_BLANK_CHOICES, ContentTypeChoiceField, ContentTypeMultipleChoiceField, DateTimePicker, DynamicModelMultipleChoiceField, FilterForm, MultipleChoiceField, StaticSelect, TagFilterField\n'), ((146, 15, 148, 9), 'utilities.forms.StaticSelect', 'StaticSelect', (), '', False, 'from utilities.forms import add_blank_choice, APISelectMultiple, BOOLEAN_WITH_BLANK_CHOICES, ContentTypeChoiceField, ContentTypeMultipleChoiceField, DateTimePicker, DynamicModelMultipleChoiceField, FilterForm, MultipleChoiceField, StaticSelect, TagFilterField\n'), ((157, 14, 157, 37), 'django.utils.translation.gettext', '_', ({(157, 16, 157, 36): '"""Tagged object type"""'}, {}), "('Tagged object type')", True, 'from django.utils.translation import gettext as _\n'), ((170, 17, 170, 37), 'dcim.models.Region.objects.all', 'Region.objects.all', ({}, {}), '()', False, 'from dcim.models import DeviceRole, DeviceType, Platform, Region, Site, SiteGroup\n'), ((172, 14, 172, 26), 'django.utils.translation.gettext', '_', ({(172, 16, 172, 25): '"""Regions"""'}, {}), "('Regions')", True, 'from django.utils.translation import gettext as _\n'), ((175, 17, 175, 40), 'dcim.models.SiteGroup.objects.all', 'SiteGroup.objects.all', ({}, {}), '()', False, 'from dcim.models import DeviceRole, DeviceType, Platform, Region, Site, SiteGroup\n'), ((177, 14, 177, 30), 'django.utils.translation.gettext', '_', ({(177, 16, 177, 29): '"""Site groups"""'}, {}), "('Site groups')", True, 'from django.utils.translation import gettext as _\n'), ((180, 17, 180, 35), 'dcim.models.Site.objects.all', 'Site.objects.all', ({}, {}), '()', False, 'from dcim.models import DeviceRole, DeviceType, Platform, Region, Site, SiteGroup\n'), ((182, 14, 182, 24), 'django.utils.translation.gettext', '_', ({(182, 16, 182, 23): '"""Sites"""'}, {}), "('Sites')", True, 'from django.utils.translation import gettext as _\n'), ((185, 17, 185, 41), 'dcim.models.DeviceType.objects.all', 'DeviceType.objects.all', ({}, {}), '()', False, 'from dcim.models import DeviceRole, DeviceType, Platform, Region, Site, SiteGroup\n'), ((187, 14, 187, 31), 'django.utils.translation.gettext', '_', ({(187, 16, 187, 30): '"""Device types"""'}, {}), "('Device types')", True, 'from django.utils.translation import gettext as _\n'), ((190, 17, 190, 41), 'dcim.models.DeviceRole.objects.all', 'DeviceRole.objects.all', ({}, {}), '()', False, 'from dcim.models import DeviceRole, DeviceType, Platform, Region, Site, SiteGroup\n'), ((192, 14, 192, 24), 'django.utils.translation.gettext', '_', ({(192, 16, 192, 23): '"""Roles"""'}, {}), "('Roles')", True, 'from django.utils.translation import gettext as _\n'), ((195, 17, 195, 39), 'dcim.models.Platform.objects.all', 'Platform.objects.all', ({}, {}), '()', False, 'from dcim.models import DeviceRole, DeviceType, Platform, Region, Site, SiteGroup\n'), ((197, 14, 197, 28), 'django.utils.translation.gettext', '_', ({(197, 16, 197, 27): '"""Platforms"""'}, {}), "('Platforms')", True, 'from django.utils.translation import gettext as _\n'), ((200, 17, 200, 42), 'virtualization.models.ClusterType.objects.all', 'ClusterType.objects.all', ({}, {}), '()', False, 'from virtualization.models import Cluster, ClusterGroup, ClusterType\n'), ((202, 14, 202, 32), 'django.utils.translation.gettext', '_', ({(202, 16, 202, 31): '"""Cluster types"""'}, {}), "('Cluster types')", True, 'from django.utils.translation import gettext as _\n'), ((206, 17, 206, 43), 'virtualization.models.ClusterGroup.objects.all', 'ClusterGroup.objects.all', ({}, {}), '()', False, 'from virtualization.models import Cluster, ClusterGroup, ClusterType\n'), ((208, 14, 208, 33), 'django.utils.translation.gettext', '_', ({(208, 16, 208, 32): '"""Cluster groups"""'}, {}), "('Cluster groups')", True, 'from django.utils.translation import gettext as _\n'), ((211, 17, 211, 38), 'virtualization.models.Cluster.objects.all', 'Cluster.objects.all', ({}, {}), '()', False, 'from virtualization.models import Cluster, ClusterGroup, ClusterType\n'), ((213, 14, 213, 27), 'django.utils.translation.gettext', '_', ({(213, 16, 213, 26): '"""Clusters"""'}, {}), "('Clusters')", True, 'from django.utils.translation import gettext as _\n'), ((216, 17, 216, 42), 'tenancy.models.TenantGroup.objects.all', 'TenantGroup.objects.all', ({}, {}), '()', False, 'from tenancy.models import Tenant, TenantGroup\n'), ((218, 14, 218, 32), 'django.utils.translation.gettext', '_', ({(218, 16, 218, 31): '"""Tenant groups"""'}, {}), "('Tenant groups')", True, 'from django.utils.translation import gettext as _\n'), ((221, 17, 221, 37), 'tenancy.models.Tenant.objects.all', 'Tenant.objects.all', ({}, {}), '()', False, 'from tenancy.models import Tenant, TenantGroup\n'), ((223, 14, 223, 25), 'django.utils.translation.gettext', '_', ({(223, 16, 223, 24): '"""Tenant"""'}, {}), "('Tenant')", True, 'from django.utils.translation import gettext as _\n'), ((228, 14, 228, 23), 'django.utils.translation.gettext', '_', ({(228, 16, 228, 22): '"""Tags"""'}, {}), "('Tags')", True, 'from django.utils.translation import gettext as _\n'), ((235, 14, 235, 48), 'django.utils.translation.gettext', '_', ({(235, 16, 235, 47): '"""Has local config context data"""'}, {}), "('Has local config context data')", True, 'from django.utils.translation import gettext as _\n'), ((236, 15, 238, 9), 'utilities.forms.StaticSelect', 'StaticSelect', (), '', False, 'from utilities.forms import add_blank_choice, APISelectMultiple, BOOLEAN_WITH_BLANK_CHOICES, ContentTypeChoiceField, ContentTypeMultipleChoiceField, DateTimePicker, DynamicModelMultipleChoiceField, FilterForm, MultipleChoiceField, StaticSelect, TagFilterField\n'), ((251, 14, 251, 24), 'django.utils.translation.gettext', '_', ({(251, 16, 251, 23): '"""After"""'}, {}), "('After')", True, 'from django.utils.translation import gettext as _\n'), ((252, 15, 252, 31), 'utilities.forms.DateTimePicker', 'DateTimePicker', ({}, {}), '()', False, 'from utilities.forms import add_blank_choice, APISelectMultiple, BOOLEAN_WITH_BLANK_CHOICES, ContentTypeChoiceField, ContentTypeMultipleChoiceField, DateTimePicker, DynamicModelMultipleChoiceField, FilterForm, MultipleChoiceField, StaticSelect, TagFilterField\n'), ((256, 14, 256, 25), 'django.utils.translation.gettext', '_', ({(256, 16, 256, 24): '"""Before"""'}, {}), "('Before')", True, 'from django.utils.translation import gettext as _\n'), ((257, 15, 257, 31), 'utilities.forms.DateTimePicker', 'DateTimePicker', ({}, {}), '()', False, 'from utilities.forms import add_blank_choice, APISelectMultiple, BOOLEAN_WITH_BLANK_CHOICES, ContentTypeChoiceField, ContentTypeMultipleChoiceField, DateTimePicker, DynamicModelMultipleChoiceField, FilterForm, MultipleChoiceField, StaticSelect, TagFilterField\n'), ((260, 17, 260, 35), 'django.contrib.auth.models.User.objects.all', 'User.objects.all', ({}, {}), '()', False, 'from django.contrib.auth.models import User\n'), ((262, 14, 262, 23), 'django.utils.translation.gettext', '_', ({(262, 16, 262, 22): '"""User"""'}, {}), "('User')", True, 'from django.utils.translation import gettext as _\n'), ((263, 15, 265, 9), 'utilities.forms.APISelectMultiple', 'APISelectMultiple', (), '', False, 'from utilities.forms import add_blank_choice, APISelectMultiple, BOOLEAN_WITH_BLANK_CHOICES, ContentTypeChoiceField, ContentTypeMultipleChoiceField, DateTimePicker, DynamicModelMultipleChoiceField, FilterForm, MultipleChoiceField, StaticSelect, TagFilterField\n'), ((268, 17, 268, 42), 'django.contrib.contenttypes.models.ContentType.objects.all', 'ContentType.objects.all', ({}, {}), '()', False, 'from django.contrib.contenttypes.models import ContentType\n'), ((270, 14, 270, 30), 'django.utils.translation.gettext', '_', ({(270, 16, 270, 29): '"""Object Type"""'}, {}), "('Object Type')", True, 'from django.utils.translation import gettext as _\n'), ((271, 15, 273, 9), 'utilities.forms.APISelectMultiple', 'APISelectMultiple', (), '', False, 'from utilities.forms import add_blank_choice, APISelectMultiple, BOOLEAN_WITH_BLANK_CHOICES, ContentTypeChoiceField, ContentTypeMultipleChoiceField, DateTimePicker, DynamicModelMultipleChoiceField, FilterForm, MultipleChoiceField, StaticSelect, TagFilterField\n'), ((276, 16, 276, 57), 'utilities.forms.add_blank_choice', 'add_blank_choice', ({(276, 33, 276, 56): 'JournalEntryKindChoices'}, {}), '(JournalEntryKindChoices)', False, 'from utilities.forms import add_blank_choice, APISelectMultiple, BOOLEAN_WITH_BLANK_CHOICES, ContentTypeChoiceField, ContentTypeMultipleChoiceField, DateTimePicker, DynamicModelMultipleChoiceField, FilterForm, MultipleChoiceField, StaticSelect, TagFilterField\n'), ((278, 15, 278, 29), 'utilities.forms.StaticSelect', 'StaticSelect', ({}, {}), '()', False, 'from utilities.forms import add_blank_choice, APISelectMultiple, BOOLEAN_WITH_BLANK_CHOICES, ContentTypeChoiceField, ContentTypeMultipleChoiceField, DateTimePicker, DynamicModelMultipleChoiceField, FilterForm, MultipleChoiceField, StaticSelect, TagFilterField\n'), ((292, 14, 292, 24), 'django.utils.translation.gettext', '_', ({(292, 16, 292, 23): '"""After"""'}, {}), "('After')", True, 'from django.utils.translation import gettext as _\n'), ((293, 15, 293, 31), 'utilities.forms.DateTimePicker', 'DateTimePicker', ({}, {}), '()', False, 'from utilities.forms import add_blank_choice, APISelectMultiple, BOOLEAN_WITH_BLANK_CHOICES, ContentTypeChoiceField, ContentTypeMultipleChoiceField, DateTimePicker, DynamicModelMultipleChoiceField, FilterForm, MultipleChoiceField, StaticSelect, TagFilterField\n'), ((297, 14, 297, 25), 'django.utils.translation.gettext', '_', ({(297, 16, 297, 24): '"""Before"""'}, {}), "('Before')", True, 'from django.utils.translation import gettext as _\n'), ((298, 15, 298, 31), 'utilities.forms.DateTimePicker', 'DateTimePicker', ({}, {}), '()', False, 'from utilities.forms import add_blank_choice, APISelectMultiple, BOOLEAN_WITH_BLANK_CHOICES, ContentTypeChoiceField, ContentTypeMultipleChoiceField, DateTimePicker, DynamicModelMultipleChoiceField, FilterForm, MultipleChoiceField, StaticSelect, TagFilterField\n'), ((301, 16, 301, 59), 'utilities.forms.add_blank_choice', 'add_blank_choice', ({(301, 33, 301, 58): 'ObjectChangeActionChoices'}, {}), '(ObjectChangeActionChoices)', False, 'from utilities.forms import add_blank_choice, APISelectMultiple, BOOLEAN_WITH_BLANK_CHOICES, ContentTypeChoiceField, ContentTypeMultipleChoiceField, DateTimePicker, DynamicModelMultipleChoiceField, FilterForm, MultipleChoiceField, StaticSelect, TagFilterField\n'), ((303, 15, 303, 29), 'utilities.forms.StaticSelect', 'StaticSelect', ({}, {}), '()', False, 'from utilities.forms import add_blank_choice, APISelectMultiple, BOOLEAN_WITH_BLANK_CHOICES, ContentTypeChoiceField, ContentTypeMultipleChoiceField, DateTimePicker, DynamicModelMultipleChoiceField, FilterForm, MultipleChoiceField, StaticSelect, TagFilterField\n'), ((306, 17, 306, 35), 'django.contrib.auth.models.User.objects.all', 'User.objects.all', ({}, {}), '()', False, 'from django.contrib.auth.models import User\n'), ((308, 14, 308, 23), 'django.utils.translation.gettext', '_', ({(308, 16, 308, 22): '"""User"""'}, {}), "('User')", True, 'from django.utils.translation import gettext as _\n'), ((309, 15, 311, 9), 'utilities.forms.APISelectMultiple', 'APISelectMultiple', (), '', False, 'from utilities.forms import add_blank_choice, APISelectMultiple, BOOLEAN_WITH_BLANK_CHOICES, ContentTypeChoiceField, ContentTypeMultipleChoiceField, DateTimePicker, DynamicModelMultipleChoiceField, FilterForm, MultipleChoiceField, StaticSelect, TagFilterField\n'), ((314, 17, 314, 42), 'django.contrib.contenttypes.models.ContentType.objects.all', 'ContentType.objects.all', ({}, {}), '()', False, 'from django.contrib.contenttypes.models import ContentType\n'), ((316, 14, 316, 30), 'django.utils.translation.gettext', '_', ({(316, 16, 316, 29): '"""Object Type"""'}, {}), "('Object Type')", True, 'from django.utils.translation import gettext as _\n'), ((317, 15, 319, 9), 'utilities.forms.APISelectMultiple', 'APISelectMultiple', (), '', False, 'from utilities.forms import add_blank_choice, APISelectMultiple, BOOLEAN_WITH_BLANK_CHOICES, ContentTypeChoiceField, ContentTypeMultipleChoiceField, DateTimePicker, DynamicModelMultipleChoiceField, FilterForm, MultipleChoiceField, StaticSelect, TagFilterField\n'), ((155, 44, 155, 64), 'extras.utils.FeatureQuery', 'FeatureQuery', ({(155, 57, 155, 63): '"""tags"""'}, {}), "('tags')", False, 'from extras.utils import FeatureQuery\n')]