def listtables(request, schema_name): insp = actions.connect() labels = get_readable_table_names(schema_name) tables = [(table, labels[table] if table in labels else None) for table in insp.get_table_names(schema=schema_name) if not table.startswith('_')] tables = sorted(tables, key=lambda x: x[0]) return render(request, 'dataedit/dataedit_tablelist.html', {'schema': schema_name, 'tables': tables})
def listschemas(request): insp = actions.connect() schemas = sorted([(schema, len( {table for table in insp.get_table_names(schema=schema) if not table.startswith('_')})) for schema in insp.get_schema_names() if schema in schema_whitelist and not schema.startswith('_')], key=lambda x: x[0]) return render(request, 'dataedit/dataedit_schemalist.html', {'schemas': schemas})