def kit_export_csv():
 output = ''
 for resourcename in ['kit', 'item', 'kit_item']:
  _table = ((module + '_') + resourcename)
  table = db[_table]
  query = auth.s3_accessible_query('read', table)
  if ('deleted' in table):
   query = (((table.deleted == False) | (table.deleted == None)) & query)
  output += (('TABLE ' + _table) + '\n')
  output += str(db(query).select())
  output += '\n\n'
 import gluon.contenttype
 response.headers['Content-Type'] = gluon.contenttype.contenttype('.csv')
 filename = ('%s_kits.csv' % request.env.server_name)
 response.headers['Content-disposition'] = ('attachment; filename=%s' % filename)
 return output

def kit_export_csv ( ) : output = '' for resourcename in [ 'kit' , 'item' , 'kit_item' ] : _table = ( ( module + '_' ) + resourcename ) table = db [ _table ] query = auth . s3_accessible_query ( 'read' , table ) if ( 'deleted' in table ) : query = ( ( ( table . deleted == False ) | ( table . deleted == None ) ) & query ) output += ( ( 'TABLE ' + _table ) + '\n' ) output += str ( db ( query ) . select ( ) ) output += '\n\n' import gluon . contenttype response . headers [ 'Content-Type' ] = gluon . contenttype . contenttype ( '.csv' ) filename = ( '%s_kits.csv' % request . env . server_name ) response . headers [ 'Content-disposition' ] = ( 'attachment; filename=%s' % filename ) return output
export kits in csv format concatenates: kits .