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
|
# 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)
|
return format_datetime(sql_format_time, timeform, substract_utc)
|
||||||
|
|
||||||
# time.localtime is useless, you need sum the time offset to the date
|
# 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)
|
return format_datetime(sql_format_time, timeform, sum_utc)
|
||||||
|
|
||||||
|
|
@ -287,6 +287,9 @@ def no_utc(timestamp):
|
||||||
|
|
||||||
return arrow.get(timestamp)
|
return arrow.get(timestamp)
|
||||||
|
|
||||||
|
# def date_to_sql(date_sql):
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class TimeClass:
|
class TimeClass:
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -38,11 +38,11 @@ class SqlClass:
|
||||||
|
|
||||||
self.conn=SqlClass.mypool.connect()
|
self.conn=SqlClass.mypool.connect()
|
||||||
|
|
||||||
|
self.conn.ping(True)
|
||||||
|
|
||||||
while not self.conn.open:
|
while not self.conn.open:
|
||||||
self.conn=SqlClass.mypool.connect()
|
self.conn=SqlClass.mypool.connect()
|
||||||
|
|
||||||
self.conn.ping(True)
|
|
||||||
|
|
||||||
self.connected=True
|
self.connected=True
|
||||||
|
|
||||||
except:
|
except:
|
||||||
|
|
|
||||||
|
|
@ -349,6 +349,8 @@ class WebModel:
|
||||||
|
|
||||||
self.enctype=False
|
self.enctype=False
|
||||||
|
|
||||||
|
self.dummy=0
|
||||||
|
|
||||||
# A method for add the connection
|
# A method for add the connection
|
||||||
|
|
||||||
def conn(self, sqlclass):
|
def conn(self, sqlclass):
|
||||||
|
|
|
||||||
|
|
@ -133,7 +133,7 @@ def home(module='', submodule='', t=t):
|
||||||
except ValueError:
|
except ValueError:
|
||||||
t.env.directories.insert(num_template, templates_path)
|
t.env.directories.insert(num_template, templates_path)
|
||||||
|
|
||||||
print(t.env.directories)
|
# print(t.env.directories)
|
||||||
#if config.reloader:
|
#if config.reloader:
|
||||||
#reload(new_module)
|
#reload(new_module)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue