예제 #1
0
    def __init__(self, *args, **kwargs):
        super(NetboxFilterForm, self).__init__(*args, **kwargs)
        self.helper = FormHelper()
        self.helper.form_action = ''
        self.helper.form_method = 'GET'
        self.helper.form_class = 'custom'

        self.helper.layout = Layout(
            Fieldset(
                'Filter devices',
                Row(
                    Column('category', css_class='medium-3'),
                    Column('room', css_class='medium-3'),
                    Column('organization', css_class='medium-3'),
                    Column('profile', css_class='medium-3'),
                    Column(
                        LabelSubmit('submit', 'Filter', css_class='postfix'),
                        css_class='medium-3',
                    ),
                ),
            ))
예제 #2
0
파일: forms.py 프로젝트: hmpf/nav
 def __init__(self, *args, **kwargs):
     super(ViewForm, self).__init__(*args, **kwargs)
     self.helper = FormHelper()
     self.helper.form_class = 'custom'
     self.helper.form_action = ''
     self.helper.form_method = 'GET'
     self.helper.layout = Layout(
         Fieldset(
             'Choose statistic',
             Row(
                 Column('view', css_class='medium-5'),
                 Column('timeframe', css_class='medium-3'),
                 Column('rows', css_class='medium-1'),
                 Column(
                     LabelSubmit('submit',
                                 'Show statistics',
                                 css_class='postfix'),
                     css_class='medium-3',
                 ),
             ),
         ))
예제 #3
0
def get_submit_button(value='Filter'):
    """Get default submit button for seeddb filter forms"""
    return LabelSubmit('submit', value, css_class='postfix')