"""User Interface for the App tables """ from gluon import current from plugin_dbui import StoreModifier class AppUI(object): @staticmethod def configure(db, T): """Configure the user interface for the history table and its foreign tables, Args: db (pyDAL.DAL): database connection T (gluon.languages.translator): language translator """ AppUI.preferences(db, T) @staticmethod def preferences(db, T): """UI for the preferences table Args: db (pyDAL.DAL): database connection T (gluon.languages.translator): language translator """ year = current.request.now.year # .................................................................... # # Grid # configuration of the grid property use to show preference values # current.app.cfgPreferences = \ dict(dbtable="preferences", height=200, nameColumnWidth=150, source={ "authorize_harvester_scan": False, "authorize_user_login": False, "harvester_start_year": year}, sourceConfig={ "authorize_harvester_scan": {"type": "boolean"}, "authorize_user_login": {"type": "boolean"}, "harvester_start_year": {"type": "number"}}, width=250, xtype="xpreferences") # .................................................................... # # Store # StoreModifier("preferences").orderby(db.preferences.property)