Ejemplo n.º 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()
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 5
0
 def __init__(self, *args, **kwargs):
     super(BasePOIForm, self).__init__(*args, **kwargs)
     self.fields['topology'].widget = PointTopologyWidget()