@register.simple_tag()<EOL>def crispy_addon(field, append="<STR_LIT>", prepend="<STR_LIT>", form_show_labels=True):
if field:<EOL><INDENT>context = Context({<EOL>'<STR_LIT>': field,<EOL>'<STR_LIT>': True,<EOL>'<STR_LIT>': form_show_labels,<EOL>})<EOL>template = loader.get_template('<STR_LIT>' % get_template_pack())<EOL>context['<STR_LIT>'] = prepend<EOL>context['<STR_LIT>'] = append<EOL>if not prepend and not append:<EOL><INDENT>raise TypeError("<STR_LIT>")<EOL><DEDENT>context = context.flatten()<EOL><DEDENT>return template.render(context)<EOL>
Renders a form field using bootstrap's prepended or appended text::

    {% crispy_addon form.my_field prepend="$" append=".00" %}

You can also just prepend or append like so

    {% crispy_addon form.my_field prepend="$" %}
    {% crispy_addon form.my_field append=".00" %}