當前位置: 首頁>>代碼示例>>Python>>正文


Python layout.Submit方法代碼示例

本文整理匯總了Python中crispy_forms.layout.Submit方法的典型用法代碼示例。如果您正苦於以下問題:Python layout.Submit方法的具體用法?Python layout.Submit怎麽用?Python layout.Submit使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在crispy_forms.layout的用法示例。


在下文中一共展示了layout.Submit方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: get_form

# 需要導入模塊: from crispy_forms import layout [as 別名]
# 或者: from crispy_forms.layout import Submit [as 別名]
def get_form(self):
        form = super().get_form()
        form.fields['facility'].widget = forms.HiddenInput()
        form.fields['observation_id'].widget = forms.HiddenInput()
        if self.request.method == 'GET':
            target_id = self.request.GET.get('target_id')
        elif self.request.method == 'POST':
            target_id = self.request.POST.get('target_id')
        cancel_url = reverse('home')
        if target_id:
            cancel_url = reverse('tom_targets:detail', kwargs={'pk': target_id})
        form.helper.layout = Layout(
            HTML('''<p>An observation record already exists in your TOM for this combination of observation ID,
                 facility, and target. Are you sure you want to create this record?</p>'''),
            'target_id',
            'facility',
            'observation_id',
            'confirm',
            FormActions(
                Submit('confirm', 'Confirm'),
                HTML(f'<a class="btn btn-outline-primary" href={cancel_url}>Cancel</a>')
            )
        )
        return form 
開發者ID:TOMToolkit,項目名稱:tom_base,代碼行數:26,代碼來源:views.py

示例2: __init__

# 需要導入模塊: from crispy_forms import layout [as 別名]
# 或者: from crispy_forms.layout import Submit [as 別名]
def __init__(self, *args, **kwargs):

        super(ActionItemForm, self).__init__(*args, **kwargs)
        self.helper = FormHelper(self)

        self.helper.layout = Layout(
            Row(
                Column(css_class='form-group col-md-3 col-xs-4'),
                Column('due_date', css_class='form-group col-md-3 col-xs-4'),
                Column('instruction', css_class='form-group col-md-3 col-xs-4'),
                css_class='form-row'
            ),
            Row(
                Column(css_class='form-group col-md-3 col-xs-4'),
                Column('comments', css_class='form-group col-md-6 col-xs-6')
            ),
            CustomCheckbox('priority'),
            Row(
                Column(Submit('submit', 'Submit'),
                    css_class='formgroup col-md-offset-3 col-xs-offset-4')
            )
        )

        self.fields['instruction'].queryset = models.ActionInstruction.objects.filter(
            active=True) 
開發者ID:SaturdayNeighborhoodHealthClinic,項目名稱:osler,代碼行數:27,代碼來源:forms.py

示例3: __init__

# 需要導入模塊: from crispy_forms import layout [as 別名]
# 或者: from crispy_forms.layout import Submit [as 別名]
def __init__(self, *args, **kwargs):
        referral_location_qs = kwargs.pop('referral_location_qs', None)
        super(PatientContactForm, self).__init__(*args, **kwargs)
        if referral_location_qs is not None:
            self.fields['appointment_location'].queryset = referral_location_qs

        self.helper = FormHelper(self)
        self.helper.form_class = 'form-horizontal'
        self.helper.label_class = 'col-lg-2'
        self.helper.field_class = 'col-lg-8'

        self.helper.add_input(Submit(
            self.SUCCESSFUL_REFERRAL,
            'Save & mark successful referral',
            css_class='btn btn-success'))
        self.helper.add_input(Submit(
            self.REQUEST_FOLLOWUP,
            'Save & request future followup',
            css_class='btn btn-info'))
        self.helper.add_input(Submit(
            self.UNSUCCESSFUL_REFERRAL,
            'Save & do not follow up again',
            css_class='btn btn-danger btn-sm')) 
開發者ID:SaturdayNeighborhoodHealthClinic,項目名稱:osler,代碼行數:25,代碼來源:forms.py

示例4: __init__

# 需要導入模塊: from crispy_forms import layout [as 別名]
# 或者: from crispy_forms.layout import Submit [as 別名]
def __init__(self, *args, **kwargs):
        super(DemographicsForm, self).__init__(*args, **kwargs)

        self.helper = FormHelper()
        self.helper.form_method = 'post'

        self.helper.layout = Layout(
                Fieldset('Medical',
                         'has_insurance',
                         'ER_visit_last_year',
                         'last_date_physician_visit',
                         'chronic_condition'),
                Fieldset('Social',
                         'lives_alone',
                         'dependents',
                         'resource_access',
                         'transportation'),
                Fieldset('Employment',
                         'currently_employed',
                         'education_level',
                         'work_status',
                         'annual_income')
        )

        self.helper.add_input(Submit('submit', 'Submit')) 
開發者ID:SaturdayNeighborhoodHealthClinic,項目名稱:osler,代碼行數:27,代碼來源:forms.py

示例5: form

# 需要導入模塊: from crispy_forms import layout [as 別名]
# 或者: from crispy_forms.layout import Submit [as 別名]
def form(self):
        form = super(FilterSet, self).form

        if compat.is_crispy():
            from crispy_forms.helper import FormHelper
            from crispy_forms.layout import Layout, Submit

            layout_components = list(form.fields.keys()) + [
                Submit('', _('Submit'), css_class='btn-default'),
            ]
            helper = FormHelper()
            helper.form_method = 'GET'
            helper.template_pack = 'bootstrap3'
            helper.layout = Layout(*layout_components)

            form.helper = helper

        return form 
開發者ID:BeanWei,項目名稱:Dailyfresh-B2C,代碼行數:20,代碼來源:filterset.py

示例6: __init__

# 需要導入模塊: from crispy_forms import layout [as 別名]
# 或者: from crispy_forms.layout import Submit [as 別名]
def __init__(self, *args, **kwargs):
        super(SuggestionForm, self).__init__(*args, **kwargs)
        # Translators: This labels a textfield where users can enter the name of the potential partner they'll suggest
        self.fields["suggested_company_name"].label = _("Name of the potential partner")
        # Translators: This labels a textfield where users can enter the description of the potential partner they'll suggest
        self.fields["description"].label = _("Description")
        # Translators: This labels a textfield where users can enter the website URL of the potential partner they'll suggest
        self.fields["company_url"].label = _("Website")
        # @TODO: This sort of gets repeated in PartnerSuggestionView.
        # We could probably be factored out to a common place for DRYness.
        self.helper = FormHelper()
        self.helper.form_tag = False
        self.helper.form_class = "form-horizontal"
        self.helper.label_class = "col-lg-3"
        self.helper.field_class = "col-lg-7"
        self.helper.layout = Layout(
            "suggested_company_name",
            "description",
            "company_url",
            "next",
            # Translators: This labels a button which users click to submit their suggestion.
            Submit("submit", _("Submit"), css_class="center-block"),
        ) 
開發者ID:WikipediaLibrary,項目名稱:TWLight,代碼行數:25,代碼來源:forms.py

示例7: __init__

# 需要導入模塊: from crispy_forms import layout [as 別名]
# 或者: from crispy_forms.layout import Submit [as 別名]
def __init__(self, *args, **kwargs):
        super(ReportIncidentForm, self).__init__(*args, **kwargs)

        self.helper = FormHelper()

        self.helper.form_action = reverse('tracker:report-incident')
        self.helper.render_hidden_fields = True
        self.helper.form_class = 'form-horizontal'
        self.helper.label_class = 'col-lg-2'
        self.helper.field_class = 'col-lg-10'
        self.helper.add_input(Submit('submit', 'Report', css_class='btn-lg btn-block')) 
開發者ID:abarto,項目名稱:tracker_project,代碼行數:13,代碼來源:forms.py

示例8: __init__

# 需要導入模塊: from crispy_forms import layout [as 別名]
# 或者: from crispy_forms.layout import Submit [as 別名]
def __init__(self, *args, **kwargs):
        super(EmailLoginForm, self).__init__(*args, **kwargs)
        self.helper = FormHelper()
        self.helper.form_method = 'post'
        self.helper.add_input(Submit('submit', _('Login'))) 
開發者ID:pythonkr,項目名稱:pyconkr-2015,代碼行數:7,代碼來源:forms.py

示例9: get_layout

# 需要導入模塊: from crispy_forms import layout [as 別名]
# 或者: from crispy_forms.layout import Submit [as 別名]
def get_layout(self, helper):
        items = [Field(x, wrapper_class="form-group") for x in self.fields]
        action = FormActions(Submit('submit', _(u'查詢')),
                             css_class="form-group")
        items.append(action)
        layout = Layout(*items)
        return layout 
開發者ID:momosecurity,項目名稱:aswan,代碼行數:9,代碼來源:forms.py

示例10: __init__

# 需要導入模塊: from crispy_forms import layout [as 別名]
# 或者: from crispy_forms.layout import Submit [as 別名]
def __init__(self, text=_("Submit"), **kwargs):
        super(SubmitButton, self).__init__(name='post', value=text, **kwargs) 
開發者ID:82Flex,項目名稱:DCRM,代碼行數:4,代碼來源:helper.py

示例11: button_layout

# 需要導入模塊: from crispy_forms import layout [as 別名]
# 或者: from crispy_forms.layout import Submit [as 別名]
def button_layout(self):
        target_id = self.initial.get('target_id')
        return ButtonHolder(
                Submit('submit', 'Submit'),
                HTML(f'''<a class="btn btn-outline-primary" href={{% url 'tom_targets:detail' {target_id} %}}>
                         Back</a>''')
            ) 
開發者ID:TOMToolkit,項目名稱:tom_base,代碼行數:9,代碼來源:facility.py

示例12: __init__

# 需要導入模塊: from crispy_forms import layout [as 別名]
# 或者: from crispy_forms.layout import Submit [as 別名]
def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.helper = FormHelper()
        self.helper.add_input(Submit('submit', 'Submit'))
        self.common_layout = Layout('facility', 'strategy_name') 
開發者ID:TOMToolkit,項目名稱:tom_base,代碼行數:7,代碼來源:observing_strategy.py

示例13: __init__

# 需要導入模塊: from crispy_forms import layout [as 別名]
# 或者: from crispy_forms.layout import Submit [as 別名]
def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.helper = FormHelper()
        self.helper.add_input(Submit('create-latex', 'Create Table'))
        # if self.is_bound:
        #     self.helper.add_input(Submit('save-latex', 'Save Latex Config'))
        self.common_layout = Layout('model_pk', 'model_name', 'table_header', 'table_footer', 'template') 
開發者ID:TOMToolkit,項目名稱:tom_base,代碼行數:9,代碼來源:latex.py

示例14: __init__

# 需要導入模塊: from crispy_forms import layout [as 別名]
# 或者: from crispy_forms.layout import Submit [as 別名]
def __init__(self, *args, **kwargs):
        self.user = kwargs.pop('user', None)
        super(TopicForm, self).__init__(*args, **kwargs)
        self.helper = FormHelper()
        self.helper.add_input(Submit('submit', _('Submit'))) 
開發者ID:ericls,項目名稱:niji,代碼行數:7,代碼來源:forms.py

示例15: __init__

# 需要導入模塊: from crispy_forms import layout [as 別名]
# 或者: from crispy_forms.layout import Submit [as 別名]
def __init__(self, *args, **kwargs):
        super(AllauthSignupForm, self).__init__(*args, **kwargs)
        self.helper = FormHelper()
        self.helper.form_method = 'post'
        self.helper.add_input(Submit('submit', 'Sign Up', css_class='btn btn-lg btn-success btn-block')) 
開發者ID:dkarchmer,項目名稱:django-aws-template,代碼行數:7,代碼來源:forms.py


注:本文中的crispy_forms.layout.Submit方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。