#NEWLINE# @ register . filter #NEWLINE# def as_uni_errors( form ) : #NEWLINE# #INDENT# '\n    Renders only form errors like django-uni-form::\n\n        {% load uni_form_tags %}\n        {{ form|as_uni_errors }}\n    ' #NEWLINE# if isinstance ( form , BaseFormSet ) : #NEWLINE# #INDENT# template = get_template ( 'uni_form/errors_formset.html' ) #NEWLINE# c = Context ( { #NEWLINE# #INDENT# 'formset' : form , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# template = get_template ( 'uni_form/errors.html' ) #NEWLINE# c = Context ( { #NEWLINE# #INDENT# 'form' : form , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# return template . render ( c )