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