def render_field_and_label(field, label, field_class=u'', label_for=None, label_class=u'', layout=u'', **kwargs):
 if (layout == u'horizontal'):
  if (not label_class):
   label_class = get_bootstrap_setting(u'horizontal_label_class')
  if (not field_class):
   field_class = get_bootstrap_setting(u'horizontal_field_class')
  if (not label):
   label = mark_safe(u'&#160;')
  label_class = add_css_class(label_class, u'control-label')
 html = field
 if field_class:
  html = u'<div class="{klass}">{html}</div>'.format(klass=field_class, html=html)
 if label:
  html = (render_label(label, label_for=label_for, label_class=label_class) + html)
 return html

def render_field_and_label ( field , label , field_class = u'' , label_for = None , label_class = u'' , layout = u'' , ** kwargs ) : if ( layout == u'horizontal' ) : if ( not label_class ) : label_class = get_bootstrap_setting ( u'horizontal_label_class' ) if ( not field_class ) : field_class = get_bootstrap_setting ( u'horizontal_field_class' ) if ( not label ) : label = mark_safe ( u'&#160;' ) label_class = add_css_class ( label_class , u'control-label' ) html = field if field_class : html = u'<div class="{klass}">{html}</div>' . format ( klass = field_class , html = html ) if label : html = ( render_label ( label , label_for = label_for , label_class = label_class ) + html ) return html
render a field with its label .