Ejemplo n.º 1
0
from ally.container import ioc, support
from ally.container.binder_op import bindValidations
from ally.support.sqlalchemy.mapper import mappingsOf
from ally.support.sqlalchemy.session import bindSession
from sql_alchemy import database_config
from sql_alchemy.database_config import alchemySessionCreator, metas, createTables
from security.meta.metadata_security import meta
from distribution.container import app

# --------------------------------------------------------------------

support.include(database_config)

# --------------------------------------------------------------------

createSecurityTables = app.analyze(createTables)
alchemySessionCreator = alchemySessionCreator


@ioc.replace(database_url)
def database_url():
    """This database URL is used for the security tables"""
    return "sqlite:///workspace/shared/security.db"


@ioc.before(metas)
def updateMetasForSecurity():
    metas().append(meta)


# --------------------------------------------------------------------
Ejemplo n.º 2
0
from ally.container.binder_op import bindValidations
from ally.support.sqlalchemy.mapper import mappingsOf
from ally.support.sqlalchemy.session import bindSession
from distribution.container import app
from internationalization.meta.metadata_internationalization import meta
from sql_alchemy import database_config
from sql_alchemy.database_config import alchemySessionCreator, metas, \
    database_url, createTables

# --------------------------------------------------------------------

support.include(database_config)

# --------------------------------------------------------------------

createInternationalizationTables = app.analyze(createTables)
alchemySessionCreator = alchemySessionCreator

@ioc.replace(database_url)
def database_url():
    '''This database URL is used for the internationalization tables'''
    return 'sqlite:///workspace/shared/internationalization.db'

@ioc.before(metas)
def updateMetasForInternationalization(): metas().append(meta)

# --------------------------------------------------------------------

def bindInternationalizationSession(proxy): bindSession(proxy, alchemySessionCreator())
def bindInternationalizationValidations(proxy): bindValidations(proxy, mappingsOf(meta))