Exemple #1
0
    def __init__(self, *args, **kwargs):
        super(SignageForm, self).__init__(*args, **kwargs)
        typefield = self.fields['type']
        typefield.queryset = typefield.queryset.for_signages()

        if not settings.SIGNAGE_LINE_ENABLED:
            self.fields['topology'].widget = PointTopologyWidget()
Exemple #2
0
    def __init__(self, *args, **kwargs):
        super(SignageForm, self).__init__(*args, **kwargs)

        if not settings.SIGNAGE_LINE_ENABLED:
            modifiable = self.fields['topology'].widget.modifiable
            self.fields['topology'].widget = PointTopologyWidget()
            self.fields['topology'].widget.modifiable = modifiable
        self.helper.form_tag = False
Exemple #3
0
    def __init__(self, *args, **kwargs):
        super(SignageForm, self).__init__(*args, **kwargs)

        if not settings.SIGNAGE_LINE_ENABLED:
            modifiable = self.fields['topology'].widget.modifiable
            self.fields['topology'].widget = PointTopologyWidget()
            self.fields['topology'].widget.modifiable = modifiable

        if self.instance.pk:
            structure = self.instance.structure
        else:
            structure = self.user.profile.structure
        self.fields['type'].queryset = SignageType.objects.filter(Q(structure=structure) | Q(structure=None))
        self.fields['condition'].queryset = InfrastructureCondition.objects.filter(
            Q(structure=structure) | Q(structure=None))
        self.helper.form_tag = False
Exemple #4
0
 def __init__(self, *args, **kwargs):
     super(BaseServiceForm, self).__init__(*args, **kwargs)
     modifiable = self.fields['topology'].widget.modifiable
     self.fields['topology'].widget = PointTopologyWidget()
     self.fields['topology'].widget.modifiable = modifiable
Exemple #5
0
 def __init__(self, *args, **kwargs):
     super(BasePOIForm, self).__init__(*args, **kwargs)
     self.fields['topology'].widget = PointTopologyWidget()