Python crispy_forms.layout 模块,Submit() 实例源码

我们从Python开源项目中,提取了以下50个代码示例,用于说明如何使用crispy_forms.layout.Submit()

项目:MetaCI    作者:SalesforceFoundation    | 项目源码 | 文件源码
def __init__(self, *args, **kwargs):
        super(DeleteNotificationForm, self).__init__(*args, **kwargs)
        self.helper = FormHelper()
        self.helper.form_class = 'form-vertical'
        self.helper.form_id = 'delete-notification-form'
        self.helper.form_method = 'post'
        self.helper.layout = Layout(
            FormActions(
                Submit(
                    'action',
                    'Cancel',
                    css_class='slds-button slds-button--neutral',
                ),
                Submit(
                    'action',
                    'Delete',
                    css_class='slds-button slds-button--destructive',
                ),
            ),
        )
项目:blogghar    作者:v1k45    | 项目源码 | 文件源码
def __init__(self, *args, **kwargs):
        self.user = kwargs.pop('user')
        super(PostForm, self).__init__(*args, **kwargs)
        self.fields['slug'].required = False
        self.fields['slug'].label = 'Slug (leave blank to auto-generate)'
        self.fields['cover'].label = 'Post cover (optional)'
        self.fields['content'].label = ''
        # making forms crispy
        self.helper = FormHelper(self)
        self.helper.include_media = False
        self.helper.add_input(Submit(
            'draft', 'draft',
            css_class='btn orange btn-large right waves-effect waves-light'))
        self.helper.add_input(Submit(
            'publish', 'publish',
            css_class='btn blue btn-large right waves-effect waves-light'))
项目:SpongeAuth    作者:lukegb    | 项目源码 | 文件源码
def __init__(self, *args, **kwargs):
        device = kwargs.pop('device')
        self.device = device

        signed_secret = kwargs.pop('secret', None)  # used for setup flow
        self.secret = signed_secret

        super().__init__(*args, **kwargs)

        self.helper = FormHelper()
        submit = Submit('submit', _('Log in'), css_class='pull-right')
        self.helper.layout = Layout(
            Field('response', autofocus='autofocus'),
            submit)

        if signed_secret:
            self.helper.layout.append(Hidden('secret', signed_secret))
            submit.value = _('Add authenticator')
项目:SpongeAuth    作者:lukegb    | 项目源码 | 文件源码
def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)

        self.helper = FormHelper()
        self.helper.layout = Layout(
            Field('username'),
            Field('password'),
            Field('email'),
            Field('mc_username'),
            Field('irc_nick'),
            Field('gh_username'),
            FormActions(
                HTML("""<a href="{{% url 'accounts:login' %}}" """
                     """class="btn btn-default">{}</a> """.format(
                         _("Log in"))),
                Submit('sign up', _("Sign up")),
                css_class="pull-right"
            )
        )
项目:SpongeAuth    作者:lukegb    | 项目源码 | 文件源码
def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)

        self.helper = FormHelper()
        self.helper.layout = Layout(
            Field('username'),
            HTML("""<i class="pull-right forgot-link">"""
                 """<a tabindex="-1" href="{{% url 'accounts:forgot' %}}">"""
                 """{}</a></i>""".format(_("Forgot your password?"))),
            Field('password'),
            HTML("""<div class="g-signin2 pull-left" """
                 """data-onsuccess="onGoogleSignIn" """
                 """data-theme="dark"></div>"""),
            FormActions(
                HTML("""<a href="{{% url 'accounts:register' %}}" """
                     """class="btn btn-default">{}</a> """.format(
                         _("Sign up"))),
                Submit('log in', _("Log in")),
                css_class="pull-right"
            )
        )
项目:postix    作者:c3cashdesk    | 项目源码 | 文件源码
def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.helper = FormHelper()
        self.helper.form_class = 'form-horizontal'
        self.helper.form_id = 'create_user_form'
        self.helper.form_method = 'post'
        self.helper.form_action = reverse('backoffice:create-user')
        self.helper.add_input(Submit('submit', 'User anlegen'))
        self.helper.label_class = 'col-lg-2'
        self.helper.field_class = 'col-lg-8'
        self.helper.layout = Layout(
            'username',
            'password',
            'firstname',
            'lastname',
            'is_backoffice_user',
            'is_troubleshooter',
        )
项目:sturdy-potato    作者:FlowFX    | 项目源码 | 文件源码
def __init__(self, *args, **kwargs):
        """Initiate form with Crispy Form's FormHelper."""
        super(AddressForm, self).__init__(*args, **kwargs)
        self.helper = FormHelper()

        self.helper.add_input(Submit('submit', 'Submit'))

        self.helper.layout = Layout(
            Fieldset(
                'An address',
                Field(
                    'street',
                    autofocus=True,
                ),
                'postal_code',
                Field('place', placeholder='Wait for it.'),
                Field('municipality', readonly='true', placeholder='Will be filled automatically.'),
                Field('city', readonly='true', placeholder='Will be filled automatically.'),
                Field('state', readonly='true', placeholder='Will be filled automatically.'),
            ),
        )

        self.fields['place'].required = True
        self.fields['street'].required = True
        self.fields['postal_code'].required = True
项目:CommunityCellularManager    作者:facebookincubator    | 项目源码 | 文件源码
def __init__(self, *args, **kwargs):
        super(SubscriberInfoForm, self).__init__(*args, **kwargs)
        self.helper = FormHelper()
        self.helper.form_id = 'id-SubscriberInfoForm'
        self.helper.form_method = 'post'
        params = {
            'imsi': kwargs.get('initial').get('imsi')
        }
        self.helper.form_action = urlresolvers.reverse(
            'subscriber-edit', kwargs=params)
        # Hide the label for the sub vacuum prevention radio.
        self.fields['prevent_automatic_deactivation'].label = ''
        self.helper.layout = Layout(
            'imsi',
            'name',
            'prevent_automatic_deactivation',
            Submit('submit', 'Save', css_class='pull-right'),
        )
项目:CommunityCellularManager    作者:facebookincubator    | 项目源码 | 文件源码
def __init__(self, *args, **kwargs):
        super(SubVacuumForm, self).__init__(*args, **kwargs)
        self.helper = FormHelper()
        self.helper.form_id = 'inactive-subscribers-form'
        self.helper.form_method = 'post'
        self.helper.form_action = '/dashboard/network/inactive-subscribers'
        # Render the inactive_days field differently depending on whether or
        # not this feature is active.
        if args[0]['sub_vacuum_enabled']:
            days_field = Field('inactive_days')
        else:
            days_field = Field('inactive_days', disabled=True)
        self.helper.layout = Layout(
            'sub_vacuum_enabled',
            days_field,
            Submit('submit', 'Save', css_class='pull-right'),
        )
项目:Django-Web-Development-with-Python    作者:PacktPublishing    | 项目源码 | 文件源码
def __init__(self, *args, **kwargs):
        super(BulletinFilterForm, self).__init__(*args, **kwargs)

        self.helper = FormHelper()
        self.helper.form_action = ""
        self.helper.form_method = "GET"

        self.helper.layout = layout.Layout(
            layout.Fieldset(
                _("Filter bulletins"),
                layout.Field("bulletin_type"),
                layout.Field("category"),
            ),
            bootstrap.FormActions(
                layout.Submit("submit", _("Filter")),
            ),
        )
项目:SaBoT    作者:froscon    | 项目源码 | 文件源码
def __init__(self, *args, **kwargs):
        super(SponsorContactForm, self).__init__(*args, **kwargs)
        self.helper = FormHelper()
        self.helper.layout = Layout(
            Field("responded"),
            Field("companyName"),
            Field("contactEMail"),
            HTML("<p class=\"text-info\">Please ensure the correctness of the address. It will later be used in the billing process.</p>"),
            Field("street"),
            Field("zipcode"),
            Field("city"),
            Field("country"),
            Field("contactPersonFirstname"),
            Field("contactPersonSurname"),
            Field("contactPersonGender"),
            Field("contactPersonEmail"),
            Field("contactPersonLanguage"),
            Field("template"),
            Field("comment")
        )
        self.helper.add_input(Submit("Save", "Save"))
项目:django-danceschool    作者:django-danceschool    | 项目源码 | 文件源码
def __init__(self, *args, **kwargs):
        self.helper = FormHelper()
        self.helper.add_input(Submit('submit', _('Submit')))
        user = kwargs.pop('user', None)

        if hasattr(user,'id'):
            kwargs.update(initial={
                'submissionUser': user.id
            })
        super(RevenueReportingForm,self).__init__(*args,**kwargs)
        self.fields['submissionUser'].widget = forms.HiddenInput()
        self.fields['invoiceNumber'].widget = forms.HiddenInput()
        self.fields["invoiceItem"] = InvoiceItemChoiceField(queryset=InvoiceItem.objects.none(),required=False)

        # re-order fields to put the associateWith RadioSelect first.
        newFields = OrderedDict()
        newFields['associateWith'] = self.fields['associateWith']
        for key,field in self.fields.items():
            if key not in ['associateWith']:
                newFields[key] = field
        self.fields = newFields
项目:studentsdb    作者:PyDev777    | 项目源码 | 文件源码
def __init__(self, *args, **kwargs):
        super(CustAuthForm, self).__init__(*args, **kwargs)

        self.helper = FormHelper(self)
        self.helper.form_action = reverse('users:auth_login')
        self.helper.form_class = 'form-horizontal'
        self.helper.label_class = 'col-sm-3'
        self.helper.field_class = 'col-sm-9'
        self.helper.error_text_inline = False
        self.helper.layout = Layout(
            Hidden('next', value=reverse('home')),
            Fieldset('', 'username', 'password',
                     HTML(u'<strong><a href="%s" class="btn btn-link col-sm-offset-3 modal-link">%s</a></strong>' % (reverse('password_reset'), _(u'Forgot your password?'))),
                     'captcha'),
            ButtonHolder(Submit('submit_button', _(u'Log in')),
                         Button('cancel_button', _(u'Cancel'), css_class='btn-default')))
项目:studentsdb    作者:PyDev777    | 项目源码 | 文件源码
def __init__(self, *args, **kwargs):
        super(CustPswResetForm, self).__init__(*args, **kwargs)

        self.helper = FormHelper(self)
        self.helper.form_action = reverse('password_reset')
        self.helper.form_class = 'form-horizontal'
        self.helper.label_class = 'col-md-3'
        self.helper.field_class = 'col-md-9'
        self.helper.error_text_inline = False
        self.helper.add_input(Submit('submit_button', _(u'Confirm')))
        self.helper.add_input(Button('cancel_button', _(u'Cancel'), css_class='btn-default'))

        # self.helper.layout = Layout(
        #     # Hidden('next', value=reverse('home')),
        #     HTML(u"<p>%s</p>" % _(u"Forgot your password? Enter your email in the form below and we'll send you instructions for creating a new one.")),
        #     Fieldset('', 'email', 'captcha'),
        #     ButtonHolder(Submit('submit_button', _(u'Confirm')),
        #                  Button('cancel_button', _(u'Cancel'), css_class='btn-default')))
项目:studentsdb    作者:PyDev777    | 项目源码 | 文件源码
def __init__(self, *args, **kwargs):
        super(CustPswChangeForm, self).__init__(*args, **kwargs)

        self.helper = FormHelper(self)
        self.helper.form_action = reverse('password_change')
        self.helper.form_class = 'form-horizontal'
        self.helper.label_class = 'col-md-3'
        self.helper.field_class = 'col-md-9'
        self.helper.error_text_inline = False
        self.helper.add_input(Submit('submit_button', _(u'Confirm')))
        self.helper.add_input(Button('cancel_button', _(u'Cancel'), css_class='btn-default'))


# def custom_activation_complete(request):
#     print 'custom_activation_complete'
#     return render(request, 'registration/activation_complete.html', {})
项目:studentsdb    作者:PyDev777    | 项目源码 | 文件源码
def __init__(self, *args, **kwargs):
        super(StudentUpdateForm, self).__init__(*args, **kwargs)
        self.helper = FormHelper(self)
        self.helper.form_class = 'form-horizontal'
        self.helper.form_method = 'POST'
        self.helper.form_action = reverse('students_edit', kwargs={'pk': kwargs['instance'].id})
        self.helper.help_text_inline = False
        self.helper.label_class = 'col-sm-4'
        self.helper.field_class = 'col-sm-7'
        self.helper.layout = Layout(
            Fieldset('', 'first_name', 'last_name', 'middle_name',
                     AppendedText('birthday', '<span class="glyphicon glyphicon-calendar"></span>'),
                     'photo', 'ticket', 'student_group', 'notes'),
            ButtonHolder(
                Submit('save_button', _(u'Save')),
                Button('cancel_button', _(u'Cancel'), css_class='btn-default')))
项目:studentsdb    作者:PyDev777    | 项目源码 | 文件源码
def __init__(self, *args, **kwargs):
        super(StudentAddForm, self).__init__(*args, **kwargs)
        self.helper = FormHelper(self)
        self.helper.form_class = 'form-horizontal'
        self.helper.form_method = 'POST'
        self.helper.form_action = reverse('students_add')
        self.helper.help_text_inline = False
        self.helper.label_class = 'col-sm-4'
        self.helper.field_class = 'col-sm-7'
        self.helper.layout = Layout(
            Fieldset('', 'first_name', 'last_name', 'middle_name',
                     AppendedText('birthday', '<span class="glyphicon glyphicon-calendar"></span>'),
                     'photo', 'ticket', 'student_group', 'notes'),
            ButtonHolder(
                Submit('save_button', _(u'Save')),
                Button('cancel_button', _(u'Cancel'), css_class='btn-default')))
项目:studentsdb2    作者:trivvet    | 项目源码 | 文件源码
def __init__(self, *args, **kwargs):
        super(ContactForm, self).__init__(*args, **kwargs)
        self.helper = FormHelper()

        # set form tag attributes
        self.helper.action = reverse('contact_admin')
        self.helper.form_method = 'POST'
        self.helper.form_class = 'form-horizontal contact-form'

        # set form field properties
        self.helper.help_text_inline = True
        self.helper.html5_required = False
        self.helper.attrs = {'novalidate': ''}
        self.helper.label_class = 'col-sm-2 control-label'
        self.helper.field_class = 'col-sm-10'


        # add buttons
        self.helper.add_input(Submit('send_button', _(u'Submit')))
项目:api-django    作者:lafranceinsoumise    | 项目源码 | 文件源码
def __init__(self, *args, poll, **kwargs):
        super().__init__(*args, **kwargs)
        self.poll = poll
        self.helper = FormHelper()

        if 'options' in self.poll.rules and self.poll.rules['options'] == 1:
            self.fields['choice'] = ModelChoiceField(
                label='Choix',
                queryset=poll.options.all().order_by('?'),
                widget=RadioSelect,
                required=True,
                empty_label=None,
                initial=None,
            )
        else:
            self.fields['choice'] = ModelMultipleChoiceField(
                label='Choix',
                queryset=poll.options.all().order_by('?'),
                widget=CheckboxSelectMultiple(),
            )

        self.helper.add_input(Submit('submit', 'Confirmer'))
项目:della    作者:avinassh    | 项目源码 | 文件源码
def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.helper = FormHelper()
        self.helper.layout = Layout(
            Fieldset(
                'Signup',
                'invite_code',
                'username',
                'email',
                'password1',
                'password2'
            )
        )
        self.helper.form_class = 'form-horizontal'
        self.helper.form_method = 'post'
        self.helper.form_action = 'user_manager:signup'
        self.helper.label_class = 'col-lg-2'
        self.helper.field_class = 'col-lg-10'
        self.helper.add_input(Reset('reset', 'Cancel'))
        self.helper.add_input(Submit('submit', 'Signup'))
项目:della    作者:avinassh    | 项目源码 | 文件源码
def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.helper = FormHelper()
        self.helper.layout = Layout(
            Fieldset(
                'Request Account Activation Code',
                'email'
            )
        )
        self.helper.form_class = 'form-horizontal'
        self.helper.form_method = 'post'
        self.helper.form_action = 'user_manager:activate-request'
        self.helper.label_class = 'col-lg-2'
        self.helper.field_class = 'col-lg-10'
        self.helper.add_input(Reset('reset', 'Cancel'))
        self.helper.add_input(Submit('submit', 'Submit'))
项目:della    作者:avinassh    | 项目源码 | 文件源码
def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)

        # make description optional field
        self.fields['description'].required = False

        self.helper = FormHelper()
        self.helper.layout = Layout(
            Fieldset(
                'Upload Image',
                'title',
                'file',
                'description'
            )
        )
        self.helper.form_class = 'form-horizontal'
        self.helper.form_method = 'post'
        self.helper.form_action = 'gallery:upload'
        self.helper.label_class = 'col-lg-2'
        self.helper.field_class = 'col-lg-10'
        self.helper.add_input(Reset('reset', 'Cancel'))
        self.helper.add_input(Submit('submit', 'Submit'))
项目:lowfat    作者:softwaresaved    | 项目源码 | 文件源码
def __init__(self, *args, **kwargs):
        super(FundReviewForm, self).__init__(*args, **kwargs)

        self.helper.layout = Layout(
            Fieldset(
                '',
                "status",
                "funds_from_default",
                "grant_default",
                "required_blog_posts",
                PrependedText(
                    "budget_approved",
                    '£',
                    min=0.00,
                    step=0.01,
                    onblur="this.value = parseFloat(this.value).toFixed(2);"
                ),
                "notes_from_admin",
                "email",
                'not_send_email_field' if self.is_staff else None,
                'not_copy_email_field' if self.is_staff else None,
            )
        )

        self.helper.add_input(Submit('submit', 'Submit'))
项目:lowfat    作者:softwaresaved    | 项目源码 | 文件源码
def __init__(self, *args, **kwargs):
        super(BlogReviewForm, self).__init__(*args, **kwargs)

        self.helper.layout = Layout(
            Fieldset(
                '',
                'draft_url',
                'final',
                'status',
                'reviewer',
                'notes_from_admin',
                'published_url',
                'title',
                'tweet_url',
                'email',
                'not_send_email_field' if self.is_staff else None,
                'not_copy_email_field' if self.is_staff else None,
                ButtonHolder(
                    Submit('submit', 'Update')
                )
                )
            )
项目:cmsplugin-form-handler    作者:mkoistinen    | 项目源码 | 文件源码
def __init__(self, source_url, instance, **kwargs):
        super(SampleCrispyModelForm, self).__init__(
            source_url, instance, **kwargs)
        self.helper = FormHelper()
        self.helper.attrs = {'novalidate': 'novalidate'}
        self.helper.form_action = reverse(
            'cmsplugin_form_handler:process_form', args=(self.plugin_id, ))
        self.helper.add_input(Submit('submit', 'Submit'))
项目:MetaCI    作者:SalesforceFoundation    | 项目源码 | 文件源码
def __init__(self, plan, repo, user, *args, **kwargs):
        self.plan = plan
        self.repo = repo
        self.user = user
        super(RunPlanForm, self).__init__(*args, **kwargs)
        self.fields['branch'].choices = self._get_branch_choices()
        self.helper = FormHelper()
        self.helper.form_class = 'form-vertical'
        self.helper.form_id = 'run-build-form'
        self.helper.form_method = 'post'
        self.helper.layout = Layout(
            Fieldset(
                'Choose the branch you want to build',
                Field('branch', css_class='slds-input'),
                css_class='slds-form-element',
            ),
            Fieldset(
                'Enter the commit you want to build.  The HEAD commit on the branch will be used if you do not specify a commit',
                Field('commit', css_class='slds-input'),
                css_class='slds-form-element',
            ),
            Fieldset(
                'Keep org? (scratch orgs only)',
                Field('keep_org', css_class='slds-checkbox'),
                css_class='slds-form-element',
            ),
            FormActions(
                Submit('submit', 'Submit',
                       css_class='slds-button slds-button--brand')
            ),
        )
项目:MetaCI    作者:SalesforceFoundation    | 项目源码 | 文件源码
def __init__(self, *args, **kwargs):
        super(AddRepositoryNotificationForm, self).__init__(*args, **kwargs)
        self.helper = FormHelper()
        self.helper.form_class = 'form-vertical'
        self.helper.form_id = 'add-repository-notification-form'
        self.helper.form_method = 'post'
        self.helper.layout = Layout(
            Fieldset(
                'Select the repository you want to received notification for',
                Field('repo', css_class='slds-input'),
                Field('user', css_class='slds-input'),
                css_class='slds-form-element',
            ),
            Fieldset(
                'Select the build statuses that should trigger a notification',
                Field('on_success', css_class='slds-input'),
                Field('on_fail', css_class='slds-input'),
                Field('on_error', css_class='slds-input'),
                css_class='slds-form-element',
            ),
            FormActions(
                Submit(
                    'submit',
                    'Submit',
                    css_class='slds-button slds-button--brand',
                ),
            ),
        )
项目:MetaCI    作者:SalesforceFoundation    | 项目源码 | 文件源码
def __init__(self, *args, **kwargs):
        super(AddBranchNotificationForm, self).__init__(*args, **kwargs)
        self.helper = FormHelper()
        self.helper.form_class = 'form-vertical'
        self.helper.form_id = 'add-branch-notification-form'
        self.helper.form_method = 'post'
        self.helper.layout = Layout(
            Fieldset(
                'Select the branch you want to received notification for',
                Field('branch', css_class='slds-input'),
                Field('user', css_class='slds-input'),
                css_class='slds-form-element',
            ),
            Fieldset(
                'Select the build statuses that should trigger a notification',
                Field('on_success', css_class='slds-input'),
                Field('on_fail', css_class='slds-input'),
                Field('on_error', css_class='slds-input'),
                css_class='slds-form-element',
            ),
            FormActions(
                Submit(
                    'submit',
                    'Submit',
                    css_class='slds-button slds-button--brand',
                ),
            ),
        )
项目:MetaCI    作者:SalesforceFoundation    | 项目源码 | 文件源码
def __init__(self, *args, **kwargs):
        super(AddPlanNotificationForm, self).__init__(*args, **kwargs)
        self.helper = FormHelper()
        self.helper.form_class = 'form-vertical'
        self.helper.form_id = 'add-plan-notification-form'
        self.helper.form_method = 'post'
        self.helper.layout = Layout(
            Fieldset(
                'Select the plan you want to received notification for',
                Field('plan', css_class='slds-input'),
                Field('user', css_class='slds-input'),
                css_class='slds-form-element',
            ),
            Fieldset(
                'Select the build statuses that should trigger a notification',
                Field('on_success', css_class='slds-input'),
                Field('on_fail', css_class='slds-input'),
                Field('on_error', css_class='slds-input'),
                css_class='slds-form-element',
            ),
            FormActions(
                Submit(
                    'submit',
                    'Submit',
                    css_class='slds-button slds-button--brand',
                ),
            ),
        )
项目:SpongeAuth    作者:lukegb    | 项目源码 | 文件源码
def __init__(self, *args, **kwargs):
        device = kwargs.pop('device')
        self.device = device

        super().__init__(*args, **kwargs)

        self.helper = FormHelper()
        submit = Submit('submit', _('Log in'), css_class='pull-right')
        self.helper.layout = Layout(
            Field('response', autofocus='autofocus'),
            submit)
项目:SpongeAuth    作者:lukegb    | 项目源码 | 文件源码
def __init__(self, *args, **kwargs):
        email_editable = kwargs.pop('email_editable', False)
        super().__init__(*args, **kwargs)
        if not email_editable:
            self.fields['email'].disabled = True
            self.fields['email'].widget.attrs['readonly'] = True
        del self.fields['password']
        self.fields['login_type'].initial = 'google'
        self.fields['form_submitted'].initial = 'yes'

        self.helper = FormHelper()
        self.helper.add_input(Submit(
            'submit', _('Sign up'), css_class="pull-right"))
项目:SpongeAuth    作者:lukegb    | 项目源码 | 文件源码
def __init__(self, *args, **kwargs):
        self.user = kwargs.pop('user')
        super().__init__(*args, **kwargs)

        self.helper = FormHelper()
        self.helper.layout = Layout(
            Field('password'),
            Submit('reset', _("Reset my password"),
                   css_class='pull-right'),
        )
项目:SpongeAuth    作者:lukegb    | 项目源码 | 文件源码
def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)

        self.helper = FormHelper()
        self.helper.add_input(Submit('profile-save', _("Save changes"),
                              css_class='pull-right'))
        self.helper.add_input(Hidden('form', 'profile'))
项目:SpongeAuth    作者:lukegb    | 项目源码 | 文件源码
def __init__(self, *args, **kwargs):
        self.user = kwargs.pop('user')
        super().__init__(*args, **kwargs)

        self.helper = FormHelper()
        self.helper.add_input(Submit('password-save', _("Change password"),
                              css_class='pull-right'))
        self.helper.add_input(Hidden('form', 'password'))
项目:SpongeAuth    作者:lukegb    | 项目源码 | 文件源码
def __init__(self, *args, **kwargs):
        self.user = kwargs.pop('user')
        super().__init__(*args, **kwargs)

        self.helper = FormHelper()
        self.helper.add_input(Submit('avatar-save', _("Set avatar"),
                              css_class='pull-right'))
        self.helper.add_input(Hidden('form', 'avatar'))
项目:SpongeAuth    作者:lukegb    | 项目源码 | 文件源码
def __init__(self, *args, **kwargs):
        self.user = kwargs.pop('user')
        super().__init__(*args, **kwargs)

        self.helper = FormHelper()
        self.helper.add_input(Submit('save', _("Change email"),
                              css_class='pull-right'))
项目:postix    作者:c3cashdesk    | 项目源码 | 文件源码
def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.helper = FormHelper()
        self.helper.form_class = 'form-horizontal'
        self.helper.add_input(Submit('submit', _('Set up settings')))
        self.helper.label_class = 'col-lg-2'
        self.helper.field_class = 'col-lg-8'
项目:postix    作者:c3cashdesk    | 项目源码 | 文件源码
def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.helper = FormHelper()
        self.helper.form_class = 'form-horizontal'
        self.helper.add_input(Submit('submit', _('Add Cashdesk')))
        self.helper.label_class = 'col-lg-2'
        self.helper.field_class = 'col-lg-8'
项目:postix    作者:c3cashdesk    | 项目源码 | 文件源码
def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.helper = FormHelper()
        self.helper.form_class = 'form-horizontal'
        self.helper.add_input(Submit('submit', _('Import presale export')))
        self.helper.label_class = 'col-lg-2'
        self.helper.field_class = 'col-lg-8'
项目:postix    作者:c3cashdesk    | 项目源码 | 文件源码
def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        if self.instance:
            valid_products = ProductItem.objects.filter(item=self.instance).values_list('product_id', flat=True)
            self.initial['products'] = Product.objects.filter(pk__in=valid_products)
        self.helper = FormHelper()
        self.helper.form_class = 'form-horizontal'
        self.helper.add_input(Submit('submit', _('Save Item')))
        self.helper.label_class = 'col-lg-2'
        self.helper.field_class = 'col-lg-8'
项目:DCRM    作者:82Flex    | 项目源码 | 文件源码
def __init__(self, text=_("Submit"), **kwargs):
        super(SubmitButton, self).__init__(name='post', value=text, **kwargs)
项目:pyconapac-2016    作者:pythonkr    | 项目源码 | 文件源码
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')))
项目:pyconapac-2016    作者:pythonkr    | 项目源码 | 文件源码
def __init__(self, *args, **kwargs):
        super(SpeakerForm, self).__init__(*args, **kwargs)
        self.helper = FormHelper()
        self.helper.form_method = 'post'
        self.helper.add_input(Submit('submit', _('Submit')))
        self.fields['image'].help_text += _('Maximum size is %d MB') \
            % settings.SPEAKER_IMAGE_MAXIMUM_FILESIZE_IN_MB
        self.fields['image'].help_text += ' / ' + _('Minimum dimension is %d x %d') \
            % settings.SPEAKER_IMAGE_MINIMUM_DIMENSION
项目:pyconapac-2016    作者:pythonkr    | 项目源码 | 文件源码
def __init__(self, *args, **kwargs):
        super(ProgramForm, self).__init__(*args, **kwargs)
        self.helper = FormHelper()
        self.helper.form_method = 'post'
        self.helper.add_input(Submit('submit', _('Submit')))
项目:pyconapac-2016    作者:pythonkr    | 项目源码 | 文件源码
def __init__(self, *args, **kwargs):
        super(ProposalForm, self).__init__(*args, **kwargs)
        self.helper = FormHelper()
        self.helper.form_method = 'post'
        self.helper.add_input(Submit('submit', _('Submit')))
项目:pyconapac-2016    作者:pythonkr    | 项目源码 | 文件源码
def __init__(self, *args, **kwargs):
        super(TutorialProposalForm, self).__init__(*args, **kwargs)
        self.helper = FormHelper()
        self.helper.form_method = 'post'
        self.helper.add_input(Submit('submit', _('Submit')))
项目:pyconapac-2016    作者:pythonkr    | 项目源码 | 文件源码
def __init__(self, *args, **kwargs):

        super(RegistrationForm, self).__init__(*args, **kwargs)
        self.fields['email'].widget.attrs['readonly'] = True
        self.fields['base_price'].widget.attrs['readonly'] = True
        self.fields['option'].widget.attrs['disabled'] = True
        self.helper = FormHelper()
        self.helper.form_id = 'registration-form'
        self.helper.form_method = 'post'
        self.helper.add_input(Submit('submit', _('Submit'), disabled='disabled'))
项目:sturdy-potato    作者:FlowFX    | 项目源码 | 文件源码
def __init__(self, *args, **kwargs):
        """Initiate form with Crispy Form's FormHelper."""
        super(PotatoForm, self).__init__(*args, **kwargs)
        self.helper = FormHelper()

        self.helper.add_input(Submit('submit', 'Submit'))
        self.helper.add_input(Submit(
            'cancel',
            'Cancel',
            css_class='btn-danger',
            formnovalidate='formnovalidate',
            )
        )
项目:portailva    作者:BdEINSALyon    | 项目源码 | 文件源码
def __init__(self, folder, *args, **kwargs):
        self.helper = FormHelper()
        self.helper.form_id = 'resource-folder-form'
        if folder is None:
            self.helper.form_action = reverse('resource-folder-create')
        else:
            self.helper.form_action = reverse('resource-folder-create', kwargs={'folder_pk': folder.id})
        super(ResourceFolderForm, self).__init__(*args, **kwargs)
        self.helper.add_input(Submit('submit', 'Créer le dossier'))
项目:portailva    作者:BdEINSALyon    | 项目源码 | 文件源码
def __init__(self, folder, *args, **kwargs):
        super(ResourceFileForm, self).__init__(*args, **kwargs)
        self.helper = FormHelper()
        self.helper.form_method = 'post'
        if folder is None:
            self.helper.form_action = reverse('resource-upload')
        else:
            self.helper.form_action = reverse('resource-upload', kwargs={'folder_pk': folder.id})
        self.helper.add_input(Submit('submit', 'Envoyer le fichier'))