Найти - Пользователи
Полная версия: Crispy forms
Начало » Django » Crispy forms
1
wadadaaa
Привет! Как отобразить Crispy - форму в виде таблицы? В доках the built-in methods: as_table, as_ul and as_p. You cannot tune up the output.
bs0d
class FormAdd(forms.Form):
    def __init__(self, *args, **kwargs):
        super(FormAdd, self).__init__(*args, **kwargs)
        self.helper = FormHelper()
        self.helper.help_text_inline = True
        self.helper.html5_required = True
        self.helper.form_class = 'form-horizontal'
        self.helper.form_action = reverse('YOUR_URL_HERE')
        self.helper.form_method = 'post'
        self.helper.label_class = 'col-sm-2'
        self.helper.field_class = 'col-sm-4'
        button = Button('send_button', 'Отправить')
        button.input_type = 'submit'
        button.field_classes = 'btn btn-success form-control'
        self.helper.add_input(button)
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB