Ejemplo n.º 1
0
__author__ = 'tom.norwood'

from avkoptionsmodels.models import Trade, GatewayTrade
from avkoptionsmodels.session import get_db_session

if __name__ == "__main__":
    session = get_db_session("test")
    gateway_trades = session.query(GatewayTrade).delete()
    trades = session.query(Trade).delete()
    session.commit()
Ejemplo n.º 2
0
__author__ = 'tombnorwood'

from avkoptionsmodels.session import get_db_session

from avkportfoliomanager.settings import load_manager_settings


manager_settings = load_manager_settings()
mode = manager_settings["mode"]
manager_db_settings = manager_settings[mode]["database"]

db_name = manager_db_settings["db_name"]
user_name = manager_db_settings["user_name"]
password = manager_db_settings["password"]
echo = manager_db_settings["echo"]

db_session = get_db_session(db_name, echo, user_name, password)