当前位置: 首页>>代码示例>>Python>>正文


Python forms.common_submit_buttons函数代码示例

本文整理汇总了Python中mod_utils.forms.common_submit_buttons函数的典型用法代码示例。如果您正苦于以下问题:Python common_submit_buttons函数的具体用法?Python common_submit_buttons怎么用?Python common_submit_buttons使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了common_submit_buttons函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

 def __init__(self, *args, **kwargs):
     super(AlarmForm, self).__init__(*args, **kwargs)
     self.helper = FormHelper()
     self.helper.form_class = 'well'
     css_class = 'col-md-6'
     self.helper.layout = Layout(
         Div(
             Div('name', css_class=css_class),
             Div('period', css_class=css_class),
             css_class='row',
         ),
         Div(
             Div('type', css_class=css_class),
             Div('alert_condition', css_class=css_class),
             css_class='row',
         ),
         Div(
             Div('alert_value', css_class=css_class),
             Div('alert_condition_add_on', css_class=css_class),
             css_class='row',
         ),
         Div(
             Div('status', css_class=css_class),
             Div('email_to_send_alarm', css_class=css_class),
             css_class='row',
         ),
     )
     if self.instance.id:
         common_submit_buttons(self.helper.layout, 'update')
     else:
         common_submit_buttons(self.helper.layout)
开发者ID:ZhiephieCook,项目名称:cdr-stats,代码行数:31,代码来源:forms.py

示例2: __init__

    def __init__(self, user, *args, **kwargs):
        super(SurveyDetailReportForm, self).__init__(*args, **kwargs)
        self.helper = FormHelper()
        self.helper.form_class = 'well'
        css_class = 'col-md-4'
        self.helper.layout = Layout(
            Div(
                Div('survey_id', css_class=css_class),
                Div('from_date', css_class=css_class),
                Div('to_date', css_class=css_class),
                css_class='row'
            ),
        )
        common_submit_buttons(self.helper.layout, 'search')

        if user:
            survey_list = []
            survey_list.append((0, _('Select Survey')))
            if user.is_superuser:
                survey_objs = Survey.objects.values_list('id', 'name', 'campaign__name').all().order_by('-id')
            else:
                survey_objs = Survey.objects.values_list('id', 'name', 'campaign__name')\
                    .filter(user=user).order_by('-id')

            for i in survey_objs:
                if i[2]:
                    survey_name = i[1] + " : " + i[2]
                else:
                    survey_name = i[1]
                survey_list.append((i[0], survey_name))
            self.fields['survey_id'].choices = survey_list
开发者ID:Osvalcosta,项目名称:newfies-dialer,代码行数:31,代码来源:forms.py

示例3: __init__

 def __init__(self, *args, **kwargs):
     super(CompareCallSearchForm, self).__init__(*args, **kwargs)
     self.helper = FormHelper()
     self.helper.form_class = 'well'
     css_class = 'col-md-3'
     self.helper.layout = Layout(
         Div(
             Div('from_date', css_class=css_class),
             Div('compare_days', css_class=css_class),
             Div('switch_id', css_class=css_class),
             Div('metric', css_class=css_class),
             # Div(HTML("""
             #     <b>Check with* : </b><br/>
             #     <div class="btn-group" data-toggle="buttons">
             #         {% for choice in form.compare_type.field.choices %}
             #         <label class="btn btn-default">
             #             <input name='{{ form.compare_type.name }}' type='radio' value='{{ choice.0 }}'/>
             #             {{ choice.1 }}
             #         </label>
             #         {% endfor %}
             #     </div>
             #    """), css_class=css_class),
             css_class='row'
         ),
     )
     common_submit_buttons(self.helper.layout, 'search')
开发者ID:B-Rich,项目名称:cdr-stats,代码行数:26,代码来源:forms.py

示例4: __init__

    def __init__(self, user, *args, **kwargs):
        super(DNCContact_fileExport, self).__init__(*args, **kwargs)
        self.helper = FormHelper()
        self.helper.form_class = 'well'
        self.helper.layout = Layout(
            Div(
                Div(Fieldset('', 'dnc_list', css_class='col-md-6')),
                css_class='row'
            ),
            Div(
                Div(HTML("""
                    <b>%s : </b>
                    <div class="btn-group" data-toggle="buttons">
                        {% for choice in form.export_to.field.choices %}
                        <label class="btn btn-default">
                            <input name='{{ form.export_to.name }}' type='radio' value='{{ choice.0 }}'/> {{ choice.1 }}
                        </label>
                        {% endfor %}
                    </div>
                   """ % _('Export to')), css_class='col-md-6'),
                css_class='row'
            ),
        )
        common_submit_buttons(self.helper.layout, 'add')

        # To get user's dnc_list list
        if user:  # and not user.is_superuser
            self.fields['dnc_list'].choices = get_dnc_list(user)
开发者ID:bitonator,项目名称:newfies-dialer,代码行数:28,代码来源:forms.py

示例5: __init__

 def __init__(self, manager_id, *args, **kwargs):
     super(TierFrontEndForm, self).__init__(*args, **kwargs)
     self.helper = FormHelper()
     self.helper.form_class = "well"
     self.helper.layout = Layout(Div(Div(Fieldset("", "agent", "queue", "level", "position", css_class="col-md-6"))))
     if self.instance.id:
         common_submit_buttons(self.helper.layout, "update")
     else:
         common_submit_buttons(self.helper.layout)
     self.fields["agent"].choices = agentprofile_list(manager_id)
     self.fields["queue"].choices = queue_list(manager_id)
开发者ID:jamesdouglas,项目名称:newfies-dialer,代码行数:11,代码来源:forms.py

示例6: __init__

 def __init__(self, user, *args, **kwargs):
     super(SMSCampaignSearchForm, self).__init__(*args, **kwargs)
     self.helper = FormHelper()
     self.helper.form_class = "well"
     css_class = "col-md-3"
     self.helper.layout = Layout(
         Div(Div("phonebook_id", css_class=css_class), Div("status", css_class=css_class), css_class="row")
     )
     common_submit_buttons(self.helper.layout, "search")
     if user:
         self.fields["phonebook_id"].choices = get_phonebook_list(user)
开发者ID:nishad89,项目名称:newfies-dialer,代码行数:11,代码来源:forms.py

示例7: __init__

    def __init__(self, *args, **kwargs):
        super(DialerAudioFileForm, self).__init__(*args, **kwargs)
        self.helper = FormHelper()
        self.helper.form_class = 'well'
        self.helper.layout = Layout(
            Div(Fieldset('', 'name', 'audio_file', css_class='col-md-4')),
        )

        if self.instance.id:
            common_submit_buttons(self.helper.layout, 'update')
        else:
            common_submit_buttons(self.helper.layout)
开发者ID:chengjunjian,项目名称:newfies-dialer,代码行数:12,代码来源:forms.py

示例8: __init__

 def __init__(self, *args, **kwargs):
     super(BillingReportForm, self).__init__(*args, **kwargs)
     self.fields['switch_id'].choices = sw_list_with_all()
     self.helper = FormHelper()
     self.helper.form_class = 'well'
     css_class = 'col-md-4'
     self.helper.layout = Layout(
         Div(
             Div('from_date', css_class=css_class),
             Div('to_date', css_class=css_class),
             Div('switch_id', css_class=css_class),
             css_class='row',
         ),
     )
     common_submit_buttons(self.helper.layout, 'search')
开发者ID:areski,项目名称:cdr-stats,代码行数:15,代码来源:forms.py

示例9: __init__

 def __init__(self, user, *args, **kwargs):
     super(SMSCampaignSearchForm, self).__init__(*args, **kwargs)
     self.helper = FormHelper()
     self.helper.form_class = 'well'
     css_class = 'col-md-3'
     self.helper.layout = Layout(
         Div(
             Div('phonebook_id', css_class=css_class),
             Div('status', css_class=css_class),
             css_class='row'
         ),
     )
     common_submit_buttons(self.helper.layout, 'search')
     if user:
         self.fields['phonebook_id'].choices = get_phonebook_list(user)
开发者ID:aristide,项目名称:newfies-dialer,代码行数:15,代码来源:forms.py

示例10: __init__

    def __init__(self, user, *args, **kwargs):
        super(ContactForm, self).__init__(*args, **kwargs)
        self.helper = FormHelper()

        if self.instance.id:
            form_action = common_submit_buttons(default_action='update')
        else:
            form_action = common_submit_buttons(default_action='add')
        css_class = 'col-md-6'
        self.helper.layout = Layout(
            TabHolder(
                Tab(
                    _('General'),
                    Div(
                        Div('phonebook', css_class=css_class),
                        Div('contact', css_class=css_class),
                        Div('last_name', css_class=css_class),
                        Div('first_name', css_class=css_class),
                        Div('status', css_class=css_class),
                        Div('email', css_class=css_class),
                        css_class='row'
                    ),
                    form_action,
                    css_class='well'
                ),
                Tab(
                    _('Advanced Data'),
                    Div(
                        Div('unit_number', css_class=css_class),
                        Div('address', css_class=css_class),
                        Div('city', css_class=css_class),
                        Div('state', css_class=css_class),
                        Div('country', css_class=css_class),
                        Div('description', css_class=css_class),
                        Div('additional_vars', css_class=css_class),
                        css_class='row'
                    ),
                    form_action,
                    css_class='well'
                ),
            ),
        )

        # To get user's phonebook list
        if user:
            self.fields['phonebook'].choices = phonebook_list(user)
开发者ID:AffiniaDialer,项目名称:newfies-dialer,代码行数:46,代码来源:forms.py


注:本文中的mod_utils.forms.common_submit_buttons函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。