Working on event related models and methods. Also, a lot of general clean up of everything.
This commit is contained in:
@@ -6,7 +6,7 @@ from app.config import settings
|
||||
from .log import *
|
||||
#from .lib_general import lookup_id_random_pop
|
||||
|
||||
from sqlalchemy import create_engine, text
|
||||
from sqlalchemy import create_engine, text, Time
|
||||
from sqlalchemy.exc import IntegrityError, OperationalError
|
||||
|
||||
|
||||
@@ -384,10 +384,21 @@ def sql_select(
|
||||
return False # Not successful
|
||||
|
||||
#log.setLevel(logging.DEBUG) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
|
||||
log.debug('*** ** * ** ***')
|
||||
log.debug(sql)
|
||||
log.debug('*** ** * ** ***')
|
||||
log.debug(data)
|
||||
log.debug('*** ** * ** ***')
|
||||
log.debug(vars(sql))
|
||||
log.debug('*** ** * ** ***')
|
||||
log.debug(dir(sql))
|
||||
log.debug('*** ** * ** ***')
|
||||
|
||||
try:
|
||||
# https://docs.sqlalchemy.org/en/13/core/tutorial.html#using-textual-sql
|
||||
# https://docs.sqlalchemy.org/en/13/core/sqlelement.html#sqlalchemy.sql.expression.TextClause.columns
|
||||
# https://docs.sqlalchemy.org/en/13/core/type_basics.html
|
||||
sql = sql.columns(recurring_start_time=Time, recurring_end_time=Time)
|
||||
if data:
|
||||
log.info('Executing with SQL statement and data...')
|
||||
result = db.execute(sql, data)
|
||||
|
||||
Reference in New Issue
Block a user