|
|
|
|
@ -147,7 +147,6 @@ class ServiceControlForm(forms.Form): |
|
|
|
|
widget=forms.CheckboxSelectMultiple(), |
|
|
|
|
choices=[(item['service_bit'], item['verbose']) |
|
|
|
|
for item in self.event]) |
|
|
|
|
from bitfield import BitField |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class _ServiceForm(forms.Form): |
|
|
|
|
@ -155,4 +154,33 @@ class _ServiceForm(forms.Form): |
|
|
|
|
countries = forms.MultipleChoiceField(choices=[(x.id,x.name) for x in Country.objects.language().all()]) |
|
|
|
|
all_counties = forms.BooleanField(widget=forms.CheckboxInput) |
|
|
|
|
expos = forms.CharField(widget=forms.HiddenInput) |
|
|
|
|
confs = forms.CharField(widget=forms.HiddenInput) |
|
|
|
|
confs = forms.CharField(widget=forms.HiddenInput) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
from .models import LinkedService |
|
|
|
|
from django.db.models.query import EmptyQuerySet |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class LinkedServiceForm(forms.ModelForm): |
|
|
|
|
type = forms.MultipleChoiceField(choices = [(x, x) for x in list(Service.type)], widget = forms.CheckboxSelectMultiple) |
|
|
|
|
|
|
|
|
|
class Meta: |
|
|
|
|
model = LinkedService |
|
|
|
|
fields = ['countries', 'all_countries', 'expositions', 'conferences'] |
|
|
|
|
widgets={ |
|
|
|
|
'expositions': forms.HiddenInput, |
|
|
|
|
'conferences': forms.HiddenInput |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
def clean_expositions(self): |
|
|
|
|
expositions = EmptyQuerySet() |
|
|
|
|
if self.cleaned_data['expositions']: |
|
|
|
|
expositions = Exposition.objects.language().filter(id__in=list(set(self.cleaned_data['expositions']))) |
|
|
|
|
return expositions |
|
|
|
|
|
|
|
|
|
def clean_conferences(self): |
|
|
|
|
conferences = EmptyQuerySet() |
|
|
|
|
if self.cleaned_data['conferences']: |
|
|
|
|
conferences = Conference.objects.language().filter(id__in=list(set(self.cleaned_data['conferences']))) |
|
|
|
|
return conferences |
|
|
|
|
|
|
|
|
|
|