|
@@ -14,7 +14,6 @@ from utilities.forms import (
|
|
|
BOOLEAN_WITH_BLANK_CHOICES,
|
|
BOOLEAN_WITH_BLANK_CHOICES,
|
|
|
)
|
|
)
|
|
|
from .choices import *
|
|
from .choices import *
|
|
|
-from .constants import *
|
|
|
|
|
from .models import ConfigContext, CustomField, CustomFieldValue, ImageAttachment, ObjectChange, Tag
|
|
from .models import ConfigContext, CustomField, CustomFieldValue, ImageAttachment, ObjectChange, Tag
|
|
|
|
|
|
|
|
|
|
|
|
@@ -238,6 +237,14 @@ class TagBulkEditForm(BootstrapMixin, BulkEditForm):
|
|
|
#
|
|
#
|
|
|
|
|
|
|
|
class ConfigContextForm(BootstrapMixin, forms.ModelForm):
|
|
class ConfigContextForm(BootstrapMixin, forms.ModelForm):
|
|
|
|
|
+ tags = forms.ModelMultipleChoiceField(
|
|
|
|
|
+ queryset=Tag.objects.all(),
|
|
|
|
|
+ to_field_name='slug',
|
|
|
|
|
+ required=False,
|
|
|
|
|
+ widget=APISelectMultiple(
|
|
|
|
|
+ api_url="/api/extras/tags/"
|
|
|
|
|
+ )
|
|
|
|
|
+ )
|
|
|
data = JSONField(
|
|
data = JSONField(
|
|
|
label=''
|
|
label=''
|
|
|
)
|
|
)
|
|
@@ -246,7 +253,7 @@ class ConfigContextForm(BootstrapMixin, forms.ModelForm):
|
|
|
model = ConfigContext
|
|
model = ConfigContext
|
|
|
fields = [
|
|
fields = [
|
|
|
'name', 'weight', 'description', 'is_active', 'regions', 'sites', 'roles', 'platforms', 'tenant_groups',
|
|
'name', 'weight', 'description', 'is_active', 'regions', 'sites', 'roles', 'platforms', 'tenant_groups',
|
|
|
- 'tenants', 'data',
|
|
|
|
|
|
|
+ 'tenants', 'tags', 'data',
|
|
|
]
|
|
]
|
|
|
widgets = {
|
|
widgets = {
|
|
|
'regions': APISelectMultiple(
|
|
'regions': APISelectMultiple(
|
|
@@ -266,7 +273,7 @@ class ConfigContextForm(BootstrapMixin, forms.ModelForm):
|
|
|
),
|
|
),
|
|
|
'tenants': APISelectMultiple(
|
|
'tenants': APISelectMultiple(
|
|
|
api_url="/api/tenancy/tenants/"
|
|
api_url="/api/tenancy/tenants/"
|
|
|
- )
|
|
|
|
|
|
|
+ ),
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -347,6 +354,14 @@ class ConfigContextFilterForm(BootstrapMixin, forms.Form):
|
|
|
value_field="slug",
|
|
value_field="slug",
|
|
|
)
|
|
)
|
|
|
)
|
|
)
|
|
|
|
|
+ tag = FilterChoiceField(
|
|
|
|
|
+ queryset=Tag.objects.all(),
|
|
|
|
|
+ to_field_name='slug',
|
|
|
|
|
+ widget=APISelectMultiple(
|
|
|
|
|
+ api_url="/api/extras/tags/",
|
|
|
|
|
+ value_field="slug",
|
|
|
|
|
+ )
|
|
|
|
|
+ )
|
|
|
|
|
|
|
|
|
|
|
|
|
#
|
|
#
|