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/',
        )
    )

[((1571, 1605), 'django.forms.IntegerField', 'forms.IntegerField', ([], {'required': '(False)'}), '(required=False)\n', (1589, 1605), False, 'from django import forms\n'), ((2437, 2471), 'django.forms.IntegerField', 'forms.IntegerField', ([], {'required': '(False)'}), '(required=False)\n', (2455, 2471), False, 'from django import forms\n'), ((2958, 2989), 'django.forms.CharField', 'forms.CharField', ([], {'required': '(False)'}), '(required=False)\n', (2973, 2989), False, 'from django import forms\n'), ((8239, 8260), 'utilities.forms.TagFilterField', 'TagFilterField', (['model'], {}), '(model)\n', (8253, 8260), False, 'from utilities.forms import add_blank_choice, APISelectMultiple, BOOLEAN_WITH_BLANK_CHOICES, ContentTypeChoiceField, ContentTypeMultipleChoiceField, DateTimePicker, DynamicModelMultipleChoiceField, FilterForm, MultipleChoiceField, StaticSelect, TagFilterField\n'), ((1314, 1339), 'django.contrib.contenttypes.models.ContentType.objects.all', 'ContentType.objects.all', ([], {}), '()\n', (1337, 1339), False, 'from django.contrib.contenttypes.models import ContentType\n'), ((1366, 1395), 'extras.utils.FeatureQuery', 'FeatureQuery', (['"""custom_fields"""'], {}), "('custom_fields')\n", (1378, 1395), False, 'from extras.utils import FeatureQuery\n'), ((1536, 1551), 'django.utils.translation.gettext', '_', (['"""Field type"""'], {}), "('Field type')\n", (1537, 1551), True, 'from django.utils.translation import gettext as _\n'), ((1698, 1746), 'utilities.forms.StaticSelect', 'StaticSelect', ([], {'choices': 'BOOLEAN_WITH_BLANK_CHOICES'}), '(choices=BOOLEAN_WITH_BLANK_CHOICES)\n', (1710, 1746), False, 'from utilities.forms import add_blank_choice, APISelectMultiple, BOOLEAN_WITH_BLANK_CHOICES, ContentTypeChoiceField, ContentTypeMultipleChoiceField, DateTimePicker, DynamicModelMultipleChoiceField, FilterForm, MultipleChoiceField, StaticSelect, TagFilterField\n'), ((2002, 2027), 'django.contrib.contenttypes.models.ContentType.objects.all', 'ContentType.objects.all', ([], {}), '()\n', (2025, 2027), False, 'from django.contrib.contenttypes.models import ContentType\n'), ((2054, 2082), 'extras.utils.FeatureQuery', 'FeatureQuery', (['"""custom_links"""'], {}), "('custom_links')\n", (2066, 2082), False, 'from extras.utils import FeatureQuery\n'), ((2190, 2238), 'utilities.forms.StaticSelect', 'StaticSelect', ([], {'choices': 'BOOLEAN_WITH_BLANK_CHOICES'}), '(choices=BOOLEAN_WITH_BLANK_CHOICES)\n', (2202, 2238), False, 'from utilities.forms import add_blank_choice, APISelectMultiple, BOOLEAN_WITH_BLANK_CHOICES, ContentTypeChoiceField, ContentTypeMultipleChoiceField, DateTimePicker, DynamicModelMultipleChoiceField, FilterForm, MultipleChoiceField, StaticSelect, TagFilterField\n'), ((2347, 2395), 'utilities.forms.StaticSelect', 'StaticSelect', ([], {'choices': 'BOOLEAN_WITH_BLANK_CHOICES'}), '(choices=BOOLEAN_WITH_BLANK_CHOICES)\n', (2359, 2395), False, 'from utilities.forms import add_blank_choice, APISelectMultiple, BOOLEAN_WITH_BLANK_CHOICES, ContentTypeChoiceField, ContentTypeMultipleChoiceField, DateTimePicker, DynamicModelMultipleChoiceField, FilterForm, MultipleChoiceField, StaticSelect, TagFilterField\n'), ((2730, 2755), 'django.contrib.contenttypes.models.ContentType.objects.all', 'ContentType.objects.all', ([], {}), '()\n', (2753, 2755), False, 'from django.contrib.contenttypes.models import ContentType\n'), ((2782, 2814), 'extras.utils.FeatureQuery', 'FeatureQuery', (['"""export_templates"""'], {}), "('export_templates')\n", (2794, 2814), False, 'from extras.utils import FeatureQuery\n'), ((2916, 2930), 'django.utils.translation.gettext', '_', (['"""MIME type"""'], {}), "('MIME type')\n", (2917, 2930), True, 'from django.utils.translation import gettext as _\n'), ((3087, 3135), 'utilities.forms.StaticSelect', 'StaticSelect', ([], {'choices': 'BOOLEAN_WITH_BLANK_CHOICES'}), '(choices=BOOLEAN_WITH_BLANK_CHOICES)\n', (3099, 3135), False, 'from utilities.forms import add_blank_choice, APISelectMultiple, BOOLEAN_WITH_BLANK_CHOICES, ContentTypeChoiceField, ContentTypeMultipleChoiceField, DateTimePicker, DynamicModelMultipleChoiceField, FilterForm, MultipleChoiceField, StaticSelect, TagFilterField\n'), ((3456, 3481), 'django.contrib.contenttypes.models.ContentType.objects.all', 'ContentType.objects.all', ([], {}), '()\n', (3479, 3481), False, 'from django.contrib.contenttypes.models import ContentType\n'), ((3508, 3532), 'extras.utils.FeatureQuery', 'FeatureQuery', (['"""webhooks"""'], {}), "('webhooks')\n", (3520, 3532), False, 'from extras.utils import FeatureQuery\n'), ((3682, 3698), 'django.utils.translation.gettext', '_', (['"""HTTP method"""'], {}), "('HTTP method')\n", (3683, 3698), True, 'from django.utils.translation import gettext as _\n'), ((3782, 3830), 'utilities.forms.StaticSelect', 'StaticSelect', ([], {'choices': 'BOOLEAN_WITH_BLANK_CHOICES'}), '(choices=BOOLEAN_WITH_BLANK_CHOICES)\n', (3794, 3830), False, 'from utilities.forms import add_blank_choice, APISelectMultiple, BOOLEAN_WITH_BLANK_CHOICES, ContentTypeChoiceField, ContentTypeMultipleChoiceField, DateTimePicker, DynamicModelMultipleChoiceField, FilterForm, MultipleChoiceField, StaticSelect, TagFilterField\n'), ((3940, 3988), 'utilities.forms.StaticSelect', 'StaticSelect', ([], {'choices': 'BOOLEAN_WITH_BLANK_CHOICES'}), '(choices=BOOLEAN_WITH_BLANK_CHOICES)\n', (3952, 3988), False, 'from utilities.forms import add_blank_choice, APISelectMultiple, BOOLEAN_WITH_BLANK_CHOICES, ContentTypeChoiceField, ContentTypeMultipleChoiceField, DateTimePicker, DynamicModelMultipleChoiceField, FilterForm, MultipleChoiceField, StaticSelect, TagFilterField\n'), ((4098, 4146), 'utilities.forms.StaticSelect', 'StaticSelect', ([], {'choices': 'BOOLEAN_WITH_BLANK_CHOICES'}), '(choices=BOOLEAN_WITH_BLANK_CHOICES)\n', (4110, 4146), False, 'from utilities.forms import add_blank_choice, APISelectMultiple, BOOLEAN_WITH_BLANK_CHOICES, ContentTypeChoiceField, ContentTypeMultipleChoiceField, DateTimePicker, DynamicModelMultipleChoiceField, FilterForm, MultipleChoiceField, StaticSelect, TagFilterField\n'), ((4256, 4304), 'utilities.forms.StaticSelect', 'StaticSelect', ([], {'choices': 'BOOLEAN_WITH_BLANK_CHOICES'}), '(choices=BOOLEAN_WITH_BLANK_CHOICES)\n', (4268, 4304), False, 'from utilities.forms import add_blank_choice, APISelectMultiple, BOOLEAN_WITH_BLANK_CHOICES, ContentTypeChoiceField, ContentTypeMultipleChoiceField, DateTimePicker, DynamicModelMultipleChoiceField, FilterForm, MultipleChoiceField, StaticSelect, TagFilterField\n'), ((4555, 4578), 'django.utils.translation.gettext', '_', (['"""Tagged object type"""'], {}), "('Tagged object type')\n", (4556, 4578), True, 'from django.utils.translation import gettext as _\n'), ((5013, 5033), 'dcim.models.Region.objects.all', 'Region.objects.all', ([], {}), '()\n', (5031, 5033), False, 'from dcim.models import DeviceRole, DeviceType, Platform, Region, Site, SiteGroup\n'), ((5073, 5085), 'django.utils.translation.gettext', '_', (['"""Regions"""'], {}), "('Regions')\n", (5074, 5085), True, 'from django.utils.translation import gettext as _\n'), ((5162, 5185), 'dcim.models.SiteGroup.objects.all', 'SiteGroup.objects.all', ([], {}), '()\n', (5183, 5185), False, 'from dcim.models import DeviceRole, DeviceType, Platform, Region, Site, SiteGroup\n'), ((5225, 5241), 'django.utils.translation.gettext', '_', (['"""Site groups"""'], {}), "('Site groups')\n", (5226, 5241), True, 'from django.utils.translation import gettext as _\n'), ((5312, 5330), 'dcim.models.Site.objects.all', 'Site.objects.all', ([], {}), '()\n', (5328, 5330), False, 'from dcim.models import DeviceRole, DeviceType, Platform, Region, Site, SiteGroup\n'), ((5370, 5380), 'django.utils.translation.gettext', '_', (['"""Sites"""'], {}), "('Sites')\n", (5371, 5380), True, 'from django.utils.translation import gettext as _\n'), ((5458, 5482), 'dcim.models.DeviceType.objects.all', 'DeviceType.objects.all', ([], {}), '()\n', (5480, 5482), False, 'from dcim.models import DeviceRole, DeviceType, Platform, Region, Site, SiteGroup\n'), ((5522, 5539), 'django.utils.translation.gettext', '_', (['"""Device types"""'], {}), "('Device types')\n", (5523, 5539), True, 'from django.utils.translation import gettext as _\n'), ((5610, 5634), 'dcim.models.DeviceRole.objects.all', 'DeviceRole.objects.all', ([], {}), '()\n', (5632, 5634), False, 'from dcim.models import DeviceRole, DeviceType, Platform, Region, Site, SiteGroup\n'), ((5674, 5684), 'django.utils.translation.gettext', '_', (['"""Roles"""'], {}), "('Roles')\n", (5675, 5684), True, 'from django.utils.translation import gettext as _\n'), ((5759, 5781), 'dcim.models.Platform.objects.all', 'Platform.objects.all', ([], {}), '()\n', (5779, 5781), False, 'from dcim.models import DeviceRole, DeviceType, Platform, Region, Site, SiteGroup\n'), ((5821, 5835), 'django.utils.translation.gettext', '_', (['"""Platforms"""'], {}), "('Platforms')\n", (5822, 5835), True, 'from django.utils.translation import gettext as _\n'), ((5914, 5939), 'virtualization.models.ClusterType.objects.all', 'ClusterType.objects.all', ([], {}), '()\n', (5937, 5939), False, 'from virtualization.models import Cluster, ClusterGroup, ClusterType\n'), ((5979, 5997), 'django.utils.translation.gettext', '_', (['"""Cluster types"""'], {}), "('Cluster types')\n", (5980, 5997), True, 'from django.utils.translation import gettext as _\n'), ((6107, 6133), 'virtualization.models.ClusterGroup.objects.all', 'ClusterGroup.objects.all', ([], {}), '()\n', (6131, 6133), False, 'from virtualization.models import Cluster, ClusterGroup, ClusterType\n'), ((6173, 6192), 'django.utils.translation.gettext', '_', (['"""Cluster groups"""'], {}), "('Cluster groups')\n", (6174, 6192), True, 'from django.utils.translation import gettext as _\n'), ((6266, 6287), 'virtualization.models.Cluster.objects.all', 'Cluster.objects.all', ([], {}), '()\n', (6285, 6287), False, 'from virtualization.models import Cluster, ClusterGroup, ClusterType\n'), ((6327, 6340), 'django.utils.translation.gettext', '_', (['"""Clusters"""'], {}), "('Clusters')\n", (6328, 6340), True, 'from django.utils.translation import gettext as _\n'), ((6419, 6444), 'tenancy.models.TenantGroup.objects.all', 'TenantGroup.objects.all', ([], {}), '()\n', (6442, 6444), False, 'from tenancy.models import Tenant, TenantGroup\n'), ((6484, 6502), 'django.utils.translation.gettext', '_', (['"""Tenant groups"""'], {}), "('Tenant groups')\n", (6485, 6502), True, 'from django.utils.translation import gettext as _\n'), ((6575, 6595), 'tenancy.models.Tenant.objects.all', 'Tenant.objects.all', ([], {}), '()\n', (6593, 6595), False, 'from tenancy.models import Tenant, TenantGroup\n'), ((6635, 6646), 'django.utils.translation.gettext', '_', (['"""Tenant"""'], {}), "('Tenant')\n", (6636, 6646), True, 'from django.utils.translation import gettext as _\n'), ((6773, 6782), 'django.utils.translation.gettext', '_', (['"""Tags"""'], {}), "('Tags')\n", (6774, 6782), True, 'from django.utils.translation import gettext as _\n'), ((6926, 6960), 'django.utils.translation.gettext', '_', (['"""Has local config context data"""'], {}), "('Has local config context data')\n", (6927, 6960), True, 'from django.utils.translation import gettext as _\n'), ((6977, 7025), 'utilities.forms.StaticSelect', 'StaticSelect', ([], {'choices': 'BOOLEAN_WITH_BLANK_CHOICES'}), '(choices=BOOLEAN_WITH_BLANK_CHOICES)\n', (6989, 7025), False, 'from utilities.forms import add_blank_choice, APISelectMultiple, BOOLEAN_WITH_BLANK_CHOICES, ContentTypeChoiceField, ContentTypeMultipleChoiceField, DateTimePicker, DynamicModelMultipleChoiceField, FilterForm, MultipleChoiceField, StaticSelect, TagFilterField\n'), ((7406, 7416), 'django.utils.translation.gettext', '_', (['"""After"""'], {}), "('After')\n", (7407, 7416), True, 'from django.utils.translation import gettext as _\n'), ((7433, 7449), 'utilities.forms.DateTimePicker', 'DateTimePicker', ([], {}), '()\n', (7447, 7449), False, 'from utilities.forms import add_blank_choice, APISelectMultiple, BOOLEAN_WITH_BLANK_CHOICES, ContentTypeChoiceField, ContentTypeMultipleChoiceField, DateTimePicker, DynamicModelMultipleChoiceField, FilterForm, MultipleChoiceField, StaticSelect, TagFilterField\n'), ((7536, 7547), 'django.utils.translation.gettext', '_', (['"""Before"""'], {}), "('Before')\n", (7537, 7547), True, 'from django.utils.translation import gettext as _\n'), ((7564, 7580), 'utilities.forms.DateTimePicker', 'DateTimePicker', ([], {}), '()\n', (7578, 7580), False, 'from utilities.forms import add_blank_choice, APISelectMultiple, BOOLEAN_WITH_BLANK_CHOICES, ContentTypeChoiceField, ContentTypeMultipleChoiceField, DateTimePicker, DynamicModelMultipleChoiceField, FilterForm, MultipleChoiceField, StaticSelect, TagFilterField\n'), ((7657, 7675), 'django.contrib.auth.models.User.objects.all', 'User.objects.all', ([], {}), '()\n', (7673, 7675), False, 'from django.contrib.auth.models import User\n'), ((7715, 7724), 'django.utils.translation.gettext', '_', (['"""User"""'], {}), "('User')\n", (7716, 7724), True, 'from django.utils.translation import gettext as _\n'), ((7741, 7787), 'utilities.forms.APISelectMultiple', 'APISelectMultiple', ([], {'api_url': '"""/api/users/users/"""'}), "(api_url='/api/users/users/')\n", (7758, 7787), False, 'from utilities.forms import add_blank_choice, APISelectMultiple, BOOLEAN_WITH_BLANK_CHOICES, ContentTypeChoiceField, ContentTypeMultipleChoiceField, DateTimePicker, DynamicModelMultipleChoiceField, FilterForm, MultipleChoiceField, StaticSelect, TagFilterField\n'), ((7897, 7922), 'django.contrib.contenttypes.models.ContentType.objects.all', 'ContentType.objects.all', ([], {}), '()\n', (7920, 7922), False, 'from django.contrib.contenttypes.models import ContentType\n'), ((7962, 7978), 'django.utils.translation.gettext', '_', (['"""Object Type"""'], {}), "('Object Type')\n", (7963, 7978), True, 'from django.utils.translation import gettext as _\n'), ((7995, 8050), 'utilities.forms.APISelectMultiple', 'APISelectMultiple', ([], {'api_url': '"""/api/extras/content-types/"""'}), "(api_url='/api/extras/content-types/')\n", (8012, 8050), False, 'from utilities.forms import add_blank_choice, APISelectMultiple, BOOLEAN_WITH_BLANK_CHOICES, ContentTypeChoiceField, ContentTypeMultipleChoiceField, DateTimePicker, DynamicModelMultipleChoiceField, FilterForm, MultipleChoiceField, StaticSelect, TagFilterField\n'), ((8126, 8167), 'utilities.forms.add_blank_choice', 'add_blank_choice', (['JournalEntryKindChoices'], {}), '(JournalEntryKindChoices)\n', (8142, 8167), False, 'from utilities.forms import add_blank_choice, APISelectMultiple, BOOLEAN_WITH_BLANK_CHOICES, ContentTypeChoiceField, ContentTypeMultipleChoiceField, DateTimePicker, DynamicModelMultipleChoiceField, FilterForm, MultipleChoiceField, StaticSelect, TagFilterField\n'), ((8208, 8222), 'utilities.forms.StaticSelect', 'StaticSelect', ([], {}), '()\n', (8220, 8222), False, 'from utilities.forms import add_blank_choice, APISelectMultiple, BOOLEAN_WITH_BLANK_CHOICES, ContentTypeChoiceField, ContentTypeMultipleChoiceField, DateTimePicker, DynamicModelMultipleChoiceField, FilterForm, MultipleChoiceField, StaticSelect, TagFilterField\n'), ((8576, 8586), 'django.utils.translation.gettext', '_', (['"""After"""'], {}), "('After')\n", (8577, 8586), True, 'from django.utils.translation import gettext as _\n'), ((8603, 8619), 'utilities.forms.DateTimePicker', 'DateTimePicker', ([], {}), '()\n', (8617, 8619), False, 'from utilities.forms import add_blank_choice, APISelectMultiple, BOOLEAN_WITH_BLANK_CHOICES, ContentTypeChoiceField, ContentTypeMultipleChoiceField, DateTimePicker, DynamicModelMultipleChoiceField, FilterForm, MultipleChoiceField, StaticSelect, TagFilterField\n'), ((8703, 8714), 'django.utils.translation.gettext', '_', (['"""Before"""'], {}), "('Before')\n", (8704, 8714), True, 'from django.utils.translation import gettext as _\n'), ((8731, 8747), 'utilities.forms.DateTimePicker', 'DateTimePicker', ([], {}), '()\n', (8745, 8747), False, 'from utilities.forms import add_blank_choice, APISelectMultiple, BOOLEAN_WITH_BLANK_CHOICES, ContentTypeChoiceField, ContentTypeMultipleChoiceField, DateTimePicker, DynamicModelMultipleChoiceField, FilterForm, MultipleChoiceField, StaticSelect, TagFilterField\n'), ((8802, 8845), 'utilities.forms.add_blank_choice', 'add_blank_choice', (['ObjectChangeActionChoices'], {}), '(ObjectChangeActionChoices)\n', (8818, 8845), False, 'from utilities.forms import add_blank_choice, APISelectMultiple, BOOLEAN_WITH_BLANK_CHOICES, ContentTypeChoiceField, ContentTypeMultipleChoiceField, DateTimePicker, DynamicModelMultipleChoiceField, FilterForm, MultipleChoiceField, StaticSelect, TagFilterField\n'), ((8886, 8900), 'utilities.forms.StaticSelect', 'StaticSelect', ([], {}), '()\n', (8898, 8900), False, 'from utilities.forms import add_blank_choice, APISelectMultiple, BOOLEAN_WITH_BLANK_CHOICES, ContentTypeChoiceField, ContentTypeMultipleChoiceField, DateTimePicker, DynamicModelMultipleChoiceField, FilterForm, MultipleChoiceField, StaticSelect, TagFilterField\n'), ((8971, 8989), 'django.contrib.auth.models.User.objects.all', 'User.objects.all', ([], {}), '()\n', (8987, 8989), False, 'from django.contrib.auth.models import User\n'), ((9029, 9038), 'django.utils.translation.gettext', '_', (['"""User"""'], {}), "('User')\n", (9030, 9038), True, 'from django.utils.translation import gettext as _\n'), ((9055, 9101), 'utilities.forms.APISelectMultiple', 'APISelectMultiple', ([], {'api_url': '"""/api/users/users/"""'}), "(api_url='/api/users/users/')\n", (9072, 9101), False, 'from utilities.forms import add_blank_choice, APISelectMultiple, BOOLEAN_WITH_BLANK_CHOICES, ContentTypeChoiceField, ContentTypeMultipleChoiceField, DateTimePicker, DynamicModelMultipleChoiceField, FilterForm, MultipleChoiceField, StaticSelect, TagFilterField\n'), ((9210, 9235), 'django.contrib.contenttypes.models.ContentType.objects.all', 'ContentType.objects.all', ([], {}), '()\n', (9233, 9235), False, 'from django.contrib.contenttypes.models import ContentType\n'), ((9275, 9291), 'django.utils.translation.gettext', '_', (['"""Object Type"""'], {}), "('Object Type')\n", (9276, 9291), True, 'from django.utils.translation import gettext as _\n'), ((9308, 9363), 'utilities.forms.APISelectMultiple', 'APISelectMultiple', ([], {'api_url': '"""/api/extras/content-types/"""'}), "(api_url='/api/extras/content-types/')\n", (9325, 9363), False, 'from utilities.forms import add_blank_choice, APISelectMultiple, BOOLEAN_WITH_BLANK_CHOICES, ContentTypeChoiceField, ContentTypeMultipleChoiceField, DateTimePicker, DynamicModelMultipleChoiceField, FilterForm, MultipleChoiceField, StaticSelect, TagFilterField\n'), ((4482, 4502), 'extras.utils.FeatureQuery', 'FeatureQuery', (['"""tags"""'], {}), "('tags')\n", (4494, 4502), False, 'from extras.utils import FeatureQuery\n')]