Commit bd6debe4 authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Add the modules constants.py.

parent f0749a16
# -*- coding: utf-8 -*-
"""Common constants used by packages
"""
import plugin_dbui as dbui
from datetime import datetime
from gluon import current
now = datetime.now()
today = now.strftime("%Y-%m-%d")
undef = current.T(dbui.UNDEF)
undef_id = dbui.UNDEF_ID
year = now.year
......@@ -6,7 +6,7 @@ import plugin_dbui as dbui
from callbacks import INHIBIT_CASCADE_DELETE
from datetime import datetime
from constants import today, undef_id
from gluon import current
from gluon.validators import IS_IN_DB
from pydal import Field
......@@ -140,9 +140,6 @@ class EvtModelCore(object):
pyDAL.Table
"""
today = datetime.now().strftime("%Y-%m-%d")
undef_id = dbui.UNDEF_ID
table = db.define_table(
"history",
......
......@@ -2,6 +2,7 @@
"""Definitions of the selector(s)
"""
from constants import year
from datetime import datetime
from gluon.validators import IS_IN_DB
from pydal import Field
......@@ -42,8 +43,6 @@ class EvtModelSelector(object):
pyDAL.Table
"""
year = datetime.now().year
table = virtdb.define_table(
"selector",
Field("year_start", "integer", default=year, label="Start"),
......
......@@ -4,6 +4,7 @@
"""
import plugin_dbui as dbui
from constants import undef
from gluon import current
fieldsModifier = dbui.FieldsModifier
......@@ -11,8 +12,6 @@ formModifier = dbui.FormModifier
gridModifier = dbui.GridModifier
storeModifier = dbui.StoreModifier
undef = current.T(dbui.UNDEF)
class EvtUiCore(object):
"""The User interface for the core tables.
......
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