def render_errors(self, type='all'):
    form_errors = None
    if (type == 'all'):
        form_errors = (self.get_fields_errors() + self.form.non_field_errors())
    elif (type == 'fields'):
        form_errors = self.get_fields_errors()
    elif (type == 'non_fields'):
        form_errors = self.form.non_field_errors()
    if form_errors:
        return render_template_file('bootstrap4/form_errors.html', context={'errors': form_errors, 'form': self.form, 'layout': self.layout, 'type': type})
    return ''
def render_errors(self, type='all'):
    form_errors = None
    if (type == 'all'):
        form_errors = (self.get_fields_errors() + self.form.non_field_errors())
    elif (type == 'fields'):
        form_errors = self.get_fields_errors()
    elif (type == 'non_fields'):
        form_errors = self.form.non_field_errors()
    if form_errors:
        return render_template_file('bootstrap4/form_errors.html', context={'errors': form_errors, 'form': self.form, 'layout': self.layout, 'type': type})
    return 