""" 0.py Place any app wide initialization here. This code gets run before any other models. """ import os from gluon.custom_import import track_changes, is_tracking_changes DEBUG = False if os.environ.get('WEB2PY_SERVER_MODE', 'live') == 'test': DEBUG = True if not is_tracking_changes(): track_changes()
#!/usr/bin/env python # coding: utf8 from gluon import * from gluon.globals import current from gluon.dal import SQLDB, GQLDB, Row, Rows, Expression from gluon.sqlhtml import represent import re from html import truncate_string table_field = re.compile('[\w_]+\.[\w_]+') if current.request.is_local: from gluon.custom_import import track_changes, is_tracking_changes track_changes(True) print "Is tracking changes: " + str(is_tracking_changes()) class BasicGrid(object): """ This an example on how to make a grid to use with rawsql """ def __init__(self, db, ctrl, method, rows_per_page=10, default_orderby=None, ui=None): """ Init """ self.db = db self.cid = None self.rows_per_page = rows_per_page self.rows_count = 0 self.paginate = None self.default_orderby = default_orderby self.next_orderby = '' self.search_string='' self.ctrl = ctrl
# coding: utf8 from gluon import * from gluon.globals import current from gluon.dal import SQLDB, GQLDB, Row, Rows, Expression from gluon.sqlhtml import represent import re from html import truncate_string table_field = re.compile("[\w_]+\.[\w_]+") if current.request.is_local: from gluon.custom_import import track_changes, is_tracking_changes track_changes(True) print "Is tracking changes: " + str(is_tracking_changes()) class BasicGrid(object): """ This an example on how to make a grid to use with rawsql """ def __init__(self, db, ctrl, method, rows_per_page=10, default_orderby=None, ui=None): """ Init """ self.db = db self.cid = None self.rows_per_page = rows_per_page self.rows_count = 0 self.paginate = None self.default_orderby = default_orderby self.next_orderby = ""
""" 0.py Place any app wide initialization here. This code gets run before any other models. """ # C0103: *Invalid name "%%s" (should match %%s)* # pylint: disable=C0103 from gluon.custom_import import track_changes, is_tracking_changes from applications.zcomix.modules.environ import server_production_mode DEBUG = False SERVER_MODE = server_production_mode(request) if SERVER_MODE == 'test': DEBUG = True if not is_tracking_changes(): track_changes()