@register.filter(name='<STR_LIT>')<EOL>def as_crispy_form(form, template_pack=TEMPLATE_PACK, label_class="<STR_LIT>", field_class="<STR_LIT>"):
if isinstance(form, BaseFormSet):<EOL><INDENT>template = uni_formset_template(template_pack)<EOL>c = Context({<EOL>'<STR_LIT>': form,<EOL>'<STR_LIT>': True,<EOL>'<STR_LIT>': True,<EOL>'<STR_LIT>': label_class,<EOL>'<STR_LIT>': field_class,<EOL>}).flatten()<EOL><DEDENT>else:<EOL><INDENT>template = uni_form_template(template_pack)<EOL>c = Context({<EOL>'<STR_LIT>': form,<EOL>'<STR_LIT>': True,<EOL>'<STR_LIT>': True,<EOL>'<STR_LIT>': label_class,<EOL>'<STR_LIT>': field_class,<EOL>}).flatten()<EOL><DEDENT>return template.render(c)<EOL>
The original and still very useful way to generate a div elegant form/formset::

    {% load crispy_forms_tags %}

    <form class="uniForm" method="post">
        {% csrf_token %}
        {{ myform|crispy }}
    </form>

or, if you want to explicitly set the template pack::

    {{ myform|crispy:"bootstrap" }}

In ``bootstrap3`` or ``bootstrap4`` for horizontal forms you can do::

    {{ myform|label_class:"col-lg-2",field_class:"col-lg-8" }}