Fixes in mysql support
This commit is contained in:
parent
ac785f904c
commit
e468fba853
4 changed files with 10 additions and 5 deletions
|
|
@ -205,13 +205,13 @@ def format_datetime(format_time, timeform, func_utc_return):
|
|||
|
||||
# This method parse local time to gmt
|
||||
|
||||
def local_to_gmt(timeform):
|
||||
def local_to_gmt(timeform, sql_format_time=sql_format_time):
|
||||
|
||||
return format_datetime(sql_format_time, timeform, substract_utc)
|
||||
|
||||
# time.localtime is useless, you need sum the time offset to the date
|
||||
|
||||
def gmt_to_local(timeform):
|
||||
def gmt_to_local(timeform, sql_format_time=sql_format_time):
|
||||
|
||||
return format_datetime(sql_format_time, timeform, sum_utc)
|
||||
|
||||
|
|
@ -287,6 +287,9 @@ def no_utc(timestamp):
|
|||
|
||||
return arrow.get(timestamp)
|
||||
|
||||
# def date_to_sql(date_sql):
|
||||
|
||||
|
||||
|
||||
class TimeClass:
|
||||
|
||||
|
|
|
|||
|
|
@ -37,11 +37,11 @@ class SqlClass:
|
|||
SqlClass.mypool=pool.QueuePool(getconn, max_overflow=self.max_overflow, pool_size=self.pool_size, recycle=self.pool_recycle)
|
||||
|
||||
self.conn=SqlClass.mypool.connect()
|
||||
|
||||
self.conn.ping(True)
|
||||
|
||||
while not self.conn.open:
|
||||
self.conn=SqlClass.mypool.connect()
|
||||
|
||||
self.conn.ping(True)
|
||||
|
||||
self.connected=True
|
||||
|
||||
|
|
|
|||
|
|
@ -349,6 +349,8 @@ class WebModel:
|
|||
|
||||
self.enctype=False
|
||||
|
||||
self.dummy=0
|
||||
|
||||
# A method for add the connection
|
||||
|
||||
def conn(self, sqlclass):
|
||||
|
|
|
|||
|
|
@ -133,7 +133,7 @@ def home(module='', submodule='', t=t):
|
|||
except ValueError:
|
||||
t.env.directories.insert(num_template, templates_path)
|
||||
|
||||
print(t.env.directories)
|
||||
# print(t.env.directories)
|
||||
#if config.reloader:
|
||||
#reload(new_module)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue