

@register.filter(name='as_crispy_field')
def as_crispy_field(field, template_pack=TEMPLATE_PACK):
    '\n    Renders a form field like a django-crispy-forms field::\n\n        {% load crispy_forms_tags %}\n        {{ form.field|as_crispy_field }}\n\n    or::\n\n        {{ form.field|as_crispy_field:"bootstrap" }}\n    '
    if ((not isinstance(field, forms.BoundField)) and settings.DEBUG):
        raise CrispyError('|as_crispy_field got passed an invalid or inexistent field')
    template = get_template(('%s/field.html' % template_pack))
    c = Context({
        'field': field,
        'form_show_errors': True,
        'form_show_labels': True,
    })
    if (django.VERSION >= (1, 8)):
        c = c.flatten()
    return c.render(c)

dataset/ETHPy150Open maraujop/django-crispy-forms/crispy_forms/templatetags/crispy_forms_filters.py as_crispy_field/VarMisuse@114/272 `template`->`c`