(self)
Override this to set extra django form-fields that can be calculated only within request context
Override this to set extra django form-fields that can be calculated only within request context
Override this to set extra django form - fields that can be calculated only within request context
def set_extra_django_form_fields(self):
        """
        Override this to set extra django form-fields that can be calculated only within request context
        """
        url = reverse(
            ConnectionSettingsListView.urlname,
            kwargs={'domain': self.domain},
        )
        self.fields['connection_settings_id'] = forms.ChoiceField(
            label=_("Connection Settings"),
            choices=self.connection_settings_choices,
            required=True,
            help_text=_(f'<a href="{url}">Add/Edit Connections Settings</a>')
        )
        self.fields['request_method'] = forms.ChoiceField(
            label=_("HTTP Request Method"),
            choices=[(rm, rm) for rm in REQUEST_METHODS],
            initial=REQUEST_POST,
            required=True,
        )
        if self.formats and len(self.formats) > 1:
            self.fields['format'] = forms.ChoiceField(
                required=True,
                label='Payload Format',
                choices=self.formats,
            )
def set_extra_django_form_fields ( self ) : url = reverse ( ConnectionSettingsListView . urlname , kwargs = { 'domain' : self . domain } , ) self . fields [ 'connection_settings_id' ] = forms . ChoiceField ( label = _ ( "Connection Settings" ) , choices = self . connection_settings_choices , required = True , help_text = _ ( f'<a href="{url}">Add/Edit Connections Settings</a>' ) ) self . fields [ 'request_method' ] = forms . ChoiceField ( label = _ ( "HTTP Request Method" ) , choices = [ ( rm , rm ) for rm in REQUEST_METHODS ] , initial = REQUEST_POST , required = True , ) if self . formats and len ( self . formats ) > 1 : self . fields [ 'format' ] = forms . ChoiceField ( required = True , label = 'Payload Format' , choices = self . formats , )