示例#1
0
文件: runtime.py 项目: metrorede/stak
def get_default_store():
    """This function returns the default/primary store.
    Notice that this store is considered read-only inside Stoqlib
    applications. Only transactions can modify objects and should be
    created using new_store().
    This store should not be closed, it will only close when we the
    application is shutdown.

    :returns: default store
    """
    if _default_store is None:
        set_default_store(db_settings.create_store())
        # We intentionally leave this open, it's the default
        # store and should only be closed when we close the
        # application
    return _default_store
示例#2
0
文件: runtime.py 项目: rg3915/stoq
def get_default_store():
    """This function returns the default/primary store.
    Notice that this store is considered read-only inside Stoqlib
    applications. Only transactions can modify objects and should be
    created using new_store().
    This store should not be closed, it will only close when we the
    application is shutdown.

    :returns: default store
    """
    if _default_store is None:
        set_default_store(db_settings.create_store())
        # We intentionally leave this open, it's the default
        # store and should only be closed when we close the
        # application
    return _default_store