Fixes in mysql support

This commit is contained in:
Antonio de la Rosa 2018-02-09 19:54:07 +01:00
parent ac785f904c
commit e468fba853
4 changed files with 10 additions and 5 deletions

View file

@ -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:

View file

@ -38,11 +38,11 @@ class SqlClass:
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
except:

View file

@ -349,6 +349,8 @@ class WebModel:
self.enctype=False
self.dummy=0
# A method for add the connection
def conn(self, sqlclass):

View file

@ -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)