Exemplo n.º 1
0
 def __init__(self, db, autocommit=False, autoflush=False, **options):
     self.sender = db.sender
     self._model_changes = {}
     Session.__init__(self, autocommit=autocommit, autoflush=autoflush,
                      expire_on_commit=False,
                      extension=db.session_extensions,
                      bind=db.engine, **options)
Exemplo n.º 2
0
 def __init__(self, db, autocommit=False, autoflush=False, **options):
     self.app = db.get_app()
     self._model_changes = {}
     Session.__init__(self, autocommit=autocommit, autoflush=autoflush,
                      extension=db.session_extensions,
                      bind=db.engine,
                      binds=db.get_binds(self.app), **options)
Exemplo n.º 3
0
 def __init__(self, db, autocommit=False, autoflush=True, **options):
     #: The application that this session belongs to.
     self.app = db.get_app()
     bind = options.pop('bind', None) or db.engine
     SessionBase.__init__(self, autocommit=autocommit, autoflush=autoflush,
                          bind=bind,
                          binds=db.get_binds(self.app), **options)
Exemplo n.º 4
0
 def __init__(self, db, autocommit=False, autoflush=False, **options):
     #import pdb; pdb.set_trace() # this is temporary!
     self.app = db.get_app()
     self._model_changes = {}
     Session.__init__(self, autocommit=autocommit, autoflush=autoflush,
                      extension=db.session_extensions,
                      bind=db.engine,
                      binds=db.get_binds(self.app), **options)
Exemplo n.º 5
0
    def __init__(self, db, autocommit=False, autoflush=True, **options):
        #: The application that this session belongs to.
        self.app = app = db.get_app()
        track_modifications = app.config["SQLALCHEMY_TRACK_MODIFICATIONS"]
        bind = options.pop("bind", None) or db.engine
        binds = options.pop("binds", db.get_binds(app))

        if track_modifications is None or track_modifications:
            _SessionSignalEvents.register(self)

        SessionBase.__init__(self, autocommit=autocommit, autoflush=autoflush, bind=bind, binds=binds, **options)
Exemplo n.º 6
0
 def __init__(self, db, autocommit=False, autoflush=True, **options):
     #: The application that this session belongs to.
     self.app = db.get_app()
     self._model_changes = {}
     #: A flag that controls weather this session should keep track of
     #: model modifications.  The default value for this attribute
     #: is set from the ``SQLALCHEMY_TRACK_MODIFICATIONS`` config
     #: key.
     self.emit_modification_signals = \
         self.app.config['SQLALCHEMY_TRACK_MODIFICATIONS']
     bind = options.pop('bind', None) or db.engine
     SessionBase.__init__(self, autocommit=autocommit, autoflush=autoflush,
                          bind=bind,
                          binds=db.get_binds(self.app), **options)
Exemplo n.º 7
0
    def __init__(self, db, autocommit=False, autoflush=True, **options):
        #: The application that this session belongs to.
        self.app = app = db.get_app()
        track_modifications = app.config["SQLALCHEMY_TRACK_MODIFICATIONS"]
        bind = options.pop("bind", None) or db.engine
        binds = options.pop("binds", db.get_binds(app))

        if track_modifications is None or track_modifications:
            _SessionSignalEvents.register(self)

        SessionBase.__init__(self,
                             autocommit=autocommit,
                             autoflush=autoflush,
                             bind=bind,
                             binds=binds,
                             **options)
Exemplo n.º 8
0
 def __init__(self, db, autocommit=False, autoflush=True, **options):
     #: The application that this session belongs to.
     self.app = db.get_app()
     self._model_changes = {}
     #: A flag that controls whether this session should keep track of
     #: model modifications.  The default value for this attribute
     #: is set from the ``SQLALCHEMY_TRACK_MODIFICATIONS`` config
     #: key.
     self.emit_modification_signals = \
         self.app.config['SQLALCHEMY_TRACK_MODIFICATIONS']
     bind = options.pop('bind', None) or db.engine
     SessionBase.__init__(self,
                          autocommit=autocommit,
                          autoflush=autoflush,
                          bind=bind,
                          binds=db.get_binds(self.app),
                          **options)
Exemplo n.º 9
0
 def __init__(self, db=None, bind=None, **options):
     if db is None:
         db = self._db
     #: The application that this session belongs to.
     self.app = db.get_app()
     self._model_changes = {}
     options.update(self._options)
     options.setdefault('autocommit', False)
     options.setdefault('autoflush', False)
     options.setdefault('binds', db.get_binds(self.app))
     #: A flag that controls weather this session should keep track of
     #: model modifications.  The default value for this attribute
     #: is set from the ``SQLALCHEMY_TRACK_MODIFICATIONS`` config
     #: key.
     self.emit_modification_signals = \
         self.app.config['SQLALCHEMY_TRACK_MODIFICATIONS']
     bind = options.pop('bind', None) or db.engine
     SessionBase.__init__(self, bind=bind, **options)
Exemplo n.º 10
0
 def __init__(self, db=None, bind=None, **options):
     if db is None:
         db = self._db
     #: The application that this session belongs to.
     self.app = db.get_app()
     self._model_changes = {}
     options.update(self._options)
     options.setdefault('autocommit', False)
     options.setdefault('autoflush', False)
     options.setdefault('binds', db.get_binds(self.app))
     #: A flag that controls weather this session should keep track of
     #: model modifications.  The default value for this attribute
     #: is set from the ``SQLALCHEMY_TRACK_MODIFICATIONS`` config
     #: key.
     self.emit_modification_signals = \
         self.app.config['SQLALCHEMY_TRACK_MODIFICATIONS']
     bind = options.pop('bind', None) or db.engine
     SessionBase.__init__(self, bind=bind, **options)
Exemplo n.º 11
0
 def __init__(self, **options):
     self._model_changes = {}
     SessionBase.__init__(self, **options)
Exemplo n.º 12
0
 def __init__(self):
     SASession.__init__(self,
                        get_engine(),
                        autoflush=True,
                        autocommit=False)
Exemplo n.º 13
0
 def __init__(self, **kw):
     kw['autocommit'] = True
     SaSession.__init__(self, **kw)
Exemplo n.º 14
0
 def __init__(self, *args, **kw):
     SessionBase.__init__(self, *args, **kw)
     self.stats = QueryStats()
Exemplo n.º 15
0
 def __init__(self, db, autocommit=False, autoflush=True, **options):
     self.db = db
     bind = options.pop('bind', None) or db.engine
     SessionBase.__init__(self, autocommit=autocommit, autoflush=autoflush, bind=bind, **options)
Exemplo n.º 16
0
 def __init__(self, *args, **options):
     self.__repository = options.pop('repository')
     SaSession.__init__(self, *args, **options)
     self.__query_factory = QueryFactory(self)
Exemplo n.º 17
0
 def __init__(self, **kw):
     kw['autocommit'] = True
     SaSession.__init__(self, **kw)
Exemplo n.º 18
0
 def __init__(self, db, autocommit=False, autoflush=False, **options):
     Session.__init__(self, autocommit=autocommit, autoflush=autoflush,
                      extension=db.session_extensions,
                      bind=db.engine, **options)
     self.app = db.app or _request_ctx_stack.top.app
     self._model_changes = {}
Exemplo n.º 19
0
 def __init__(self, *args, **options):
     self.__repository = options.pop('repository')
     SaSession.__init__(self, *args, **options)
Exemplo n.º 20
0
 def __init__(self):
     extension = [SignalEmittingSessionExtension()]
     Session.__init__(self, get_engine(), autoflush=True,
                      autocommit=False, extension=extension)
     self._model_changes = {}
Exemplo n.º 21
0
 def __init__(self, **options):
     self._model_changes = {}
     SessionBase.__init__(self, **options)
Exemplo n.º 22
0
 def __init__(self):
     SASession.__init__(self, get_engine(), autoflush=True,
                        autocommit=False)
Exemplo n.º 23
0
 def __init__(self, db, autocommit=False, autoflush=False, **options):
     Session.__init__(self, autocommit=autocommit, autoflush=autoflush,
                      bind=db.engine, **options)
Exemplo n.º 24
0
 def __init__(self, dbm=None, autocommit=False, autoflush=False, **options):
     Session.__init__(self, autocommit=autocommit, autoflush=autoflush,
                      extension=[_SignallingSessionExtension()],
                      bind=dbm.database_engine, **options)
     self._model_changes = {}
Exemplo n.º 25
0
Arquivo: sqla.py Projeto: znetor/soxo
 def __init__(self, db, autocommit=False, autoflush=False, **options):
     Session.__init__(self,
                      autocommit=autocommit,
                      autoflush=autoflush,
                      bind=db.engine,
                      **options)