Commit 5dcac611 authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Update modules to replace current.globalenv['db'] by current.db.

parent d91f839b
......@@ -33,7 +33,7 @@ def INHIBIT_CASCADE_DELETE(myset):
bool: ``True`` when the delete is inhibited
"""
db, T = current.globalenv['db'], current.T
db, T = current.db, current.T
field = myset.query.first
# protection
......@@ -130,7 +130,7 @@ def ON_UPDATE_LISTS2(myset, values):
or ("columns" in values and len(values["columns"]) > 0):
return False
db = current.globalenv['db']
db = current.db
# get the id_events and source
if "id_events" not in values or "source" not in values:
......
......@@ -62,7 +62,7 @@ def active_period(**kwargs):
stop (date): is fixed to DATE_MAX when not defined
"""
db = current.globalenv['db']
db = current.db
history = db.history
# extract database information
......@@ -377,7 +377,7 @@ def get_items(**kwargs):
* one column for each key of the history.data dictionary
"""
db = current.globalenv['db']
db = current.db
history = db.history
# database query including foreign table
......@@ -565,7 +565,7 @@ def get_items_small(**kwargs):
* one column for each key of the history.data dictionary
"""
db = current.globalenv['db']
db = current.db
history = db.history
# database query
......@@ -715,7 +715,7 @@ def get_objectlike_items(**kwargs):
* one column for each key of the history.data dictionary
"""
db = current.globalenv['db']
db = current.db
history = db.history
# database query including foreign table
......@@ -890,7 +890,7 @@ def get_peoplelike_items(**kwargs):
* one column for each key of the history.data dictionary
"""
db = current.globalenv['db']
db = current.db
history = db.history
# database query including foreign table
......
......@@ -140,7 +140,7 @@ class BaseReport(object):
"""
T = current.T
db = current.globalenv["db"]
db = current.db
config = self.config
selector = self.selector
......@@ -428,8 +428,8 @@ class List(BaseReport):
"""
def __init__(self, id_list):
db = current.globalenv["db"]
virtdb = current.globalenv["virtdb"]
db = current.db
virtdb = current.virtdb
BaseReport.__init__(
self,
......@@ -558,8 +558,8 @@ class Metric2D(BaseReport):
"""
def __init__(self, id_report):
db = current.globalenv["db"]
virtdb = current.globalenv["virtdb"]
db = current.db
virtdb = current.virtdb
BaseReport.__init__(
self,
......@@ -770,7 +770,7 @@ class Source(BaseReport):
"""
def __init__(self, name):
virtdb = current.globalenv["virtdb"]
virtdb = current.virtdb
BaseReport.__init__(
self,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment