sortable_columns_for_table() no longer uses inspect()

Refs #420
This commit is contained in:
Simon Willison 2019-04-06 18:58:51 -07:00
commit 97331f3435
5 changed files with 31 additions and 11 deletions

View file

@ -536,6 +536,15 @@ def detect_fts_sql(table):
'''.format(table=table)
def table_columns(conn, table):
return [
r[1]
for r in conn.execute(
"PRAGMA table_info({});".format(escape_sqlite(table))
).fetchall()
]
class Filter:
def __init__(self, key, display, sql_template, human_template, format='{}', numeric=False, no_argument=False):
self.key = key