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', ), ), ))
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', ), ), ))
def get_submit_button(value='Filter'): """Get default submit button for seeddb filter forms""" return LabelSubmit('submit', value, css_class='postfix')