def s3_addrow(form, label, widget, comment, formstyle, row_id, position=(-1)):
 if callable(formstyle):
  row = formstyle(row_id, label, widget, comment)
  if isinstance(row, (tuple, list)):
   for subrow in row:
    form[0].insert(position, subrow)
    if (position >= 0):
     position += 1
  else:
   form[0].insert(position, row)
 else:
  addrow(form, label, widget, comment, formstyle, row_id, position=position)
 return

def s3_addrow ( form , label , widget , comment , formstyle , row_id , position = ( - 1 ) ) : if callable ( formstyle ) : row = formstyle ( row_id , label , widget , comment ) if isinstance ( row , ( tuple , list ) ) : for subrow in row : form [ 0 ] . insert ( position , subrow ) if ( position >= 0 ) : position += 1 else : form [ 0 ] . insert ( position , row ) else : addrow ( form , label , widget , comment , formstyle , row_id , position = position ) return
add a row to a form .