Fixes in sqlalchemy interface
This commit is contained in:
parent
22b281f2f9
commit
f702f604c7
4 changed files with 18 additions and 1 deletions
|
|
@ -48,6 +48,8 @@ class GenerateAdminClass:
|
|||
self.template_verify_delete='utils/verify_delete.phtml'
|
||||
|
||||
self.url_redirect=self.url
|
||||
|
||||
self.post_update=None
|
||||
|
||||
def show(self):
|
||||
|
||||
|
|
@ -124,6 +126,10 @@ class GenerateAdminClass:
|
|||
|
||||
if insert_row(getpostfiles.post):
|
||||
set_flash_message(I18n.lang('common', 'task_successful', 'Task successful'))
|
||||
|
||||
if self.post_update:
|
||||
self.post_update(self, getpostfiles.get['id'])
|
||||
|
||||
redirect(self.url)
|
||||
else:
|
||||
url_action=add_get_parameters(self.url, op_admin=2, id=getpostfiles.get['id'])
|
||||
|
|
@ -199,6 +205,8 @@ class GenerateConfigClass:
|
|||
|
||||
self.template_insert='utils/insertform.phtml'
|
||||
|
||||
self.post_update=None
|
||||
|
||||
def show(self):
|
||||
|
||||
getpostfiles=GetPostFiles()
|
||||
|
|
@ -238,7 +246,13 @@ class GenerateConfigClass:
|
|||
if insert_model(getpostfiles.post):
|
||||
set_flash_message(I18n.lang('common', 'task_successful', 'Task successful'))
|
||||
self.model.yes_reset_conditions=True
|
||||
|
||||
if self.post_update:
|
||||
self.post_update(self)
|
||||
|
||||
redirect(self.url_redirect)
|
||||
|
||||
|
||||
else:
|
||||
|
||||
form=show_form(getpostfiles.post, edit_forms, self.t, True)
|
||||
|
|
|
|||
|
|
@ -334,6 +334,7 @@ else:
|
|||
try:
|
||||
|
||||
s=json.loads(f.read())
|
||||
os.utime(file_session)
|
||||
|
||||
except:
|
||||
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ class SqlClass:
|
|||
import MySQLdb.cursors
|
||||
SqlClass.cursors_connect=MySQLdb.cursors.DictCursor
|
||||
|
||||
engine=create_engine("mysql+%s://%s:%s@%s/%s?charset=utf8mb4" % (self.connection['db_type'], self.connection['user'], self.connection['password'], self.connection['host'], self.connection['db']))
|
||||
engine=create_engine("mysql+%s://%s:%s@%s/%s?charset=utf8mb4" % (self.connection['db_type'], self.connection['user'], self.connection['password'], self.connection['host'], self.connection['db']), pool_recycle=3600, echo_pool=True)
|
||||
|
||||
except:
|
||||
e = sys.exc_info()[0]
|
||||
|
|
|
|||
|
|
@ -944,6 +944,8 @@ class WebModel:
|
|||
sql_limit+=', '+str(limit[1])
|
||||
|
||||
self.limit='limit '+sql_limit
|
||||
|
||||
return self
|
||||
|
||||
# Method for create sql tables
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue