minor improvement
This commit is contained in:
parent
003f4cd3be
commit
94461c66f6
@ -1,6 +1,5 @@
|
|||||||
from flask import Blueprint, render_template, request, jsonify
|
from flask import Blueprint, render_template, request, jsonify
|
||||||
from sqlalchemy import select
|
from sqlalchemy import select
|
||||||
from sqlalchemy.sql.sqltypes import TEXT
|
|
||||||
from the_works.database import db
|
from the_works.database import db
|
||||||
import the_works.models
|
import the_works.models
|
||||||
import inspect
|
import inspect
|
||||||
@ -32,7 +31,7 @@ def search_all():
|
|||||||
|
|
||||||
# loop over database tables
|
# loop over database tables
|
||||||
for table in tables:
|
for table in tables:
|
||||||
text_columns = [column.key for column in table.__table__.columns if type(column.type) == TEXT]
|
text_columns = [column.key for column in table.__table__.columns if type(column.type) == db.types.TEXT]
|
||||||
hits = []
|
hits = []
|
||||||
# loop over table rows
|
# loop over table rows
|
||||||
for row in db.session.execute(select(table)):
|
for row in db.session.execute(select(table)):
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user