Ejemplo n.º 1
0
 def __init__(self, clsName, registry=None):
     self.tableName = _DelayClass(self, clsName)
     self.sqlmeta = _Delay_proxy(table=_DelayClass(self, clsName))
     self.q = self
     self.soClass = None
     classregistry.registry(registry).addClassCallback(
         clsName, lambda foreign, me: setattr(me, 'soClass', foreign), self)
Ejemplo n.º 2
0
 def __init__(self,
              name=None,
              debug=False,
              debugOutput=False,
              cache=True,
              style=None,
              autoCommit=True,
              debugThreading=False,
              registry=None,
              logger=None,
              loglevel=None):
     self.name = name
     self.debug = Boolean(debug)
     self.debugOutput = Boolean(debugOutput)
     self.debugThreading = Boolean(debugThreading)
     self.debugWriter = makeDebugWriter(self, logger, loglevel)
     self.doCache = Boolean(cache)
     self.cache = CacheSet(cache=self.doCache)
     self.style = style
     self._connectionNumbers = {}
     self._connectionCount = 1
     self.autoCommit = Boolean(autoCommit)
     self.registry = registry or None
     classregistry.registry(self.registry).addCallback(self.soClassAdded)
     registerConnectionInstance(self)
     atexit.register(_closeConnection, weakref.ref(self))
Ejemplo n.º 3
0
 def __init__(self,
              otherColumn=None,
              intermediateTable=None, **kw):
     self.intermediateTable = intermediateTable
     self.otherColumn = otherColumn
     SOMultipleJoin.__init__(self, **kw)
     classregistry.registry(self.soClass._registry).addClassCallback(
         self.otherClassName, self._setOtherRelatedClass)
Ejemplo n.º 4
0
 def __init__(self, clsName, registry=None):
     self.tableName = _DelayClass(self, clsName)
     self.sqlmeta = _Delay_proxy(table=_DelayClass(self, clsName))
     self.q = self
     self.soClass = None
     classregistry.registry(registry).addClassCallback(
         clsName, lambda foreign, me: setattr(me, "soClass", foreign), self
     )
Ejemplo n.º 5
0
 def __init__(self, soClass, name, join, joinColumn, **attrs):
     self.soClass = soClass
     self.name = name
     self.joinColumn = joinColumn
     for name, value in attrs.items():
         setattr(self, name, value)
     classregistry.registry(soClass.sqlmeta.registry).addClassCallback(
         join, self._setOtherClass)
Ejemplo n.º 6
0
 def __init__(self, soClass, name, join, joinColumn, **attrs):
     self.soClass = soClass
     self.name = name
     self.joinColumn = joinColumn
     for name, value in attrs.items():
         setattr(self, name, value)
     classregistry.registry(
         soClass.sqlmeta.registry).addClassCallback(
         join, self._setOtherClass)
Ejemplo n.º 7
0
 def __init__(self,
              otherColumn=None,
              intermediateTable=None,
              createRelatedTable=True,
              **kw):
     self.intermediateTable = intermediateTable
     self.otherColumn = otherColumn
     self.createRelatedTable = createRelatedTable
     SOMultipleJoin.__init__(self, **kw)
     classregistry.registry(self.soClass.sqlmeta.registry).addClassCallback(
         self.otherClassName, self._setOtherRelatedClass)
Ejemplo n.º 8
0
 def __init__(self, soClass, name, join, intermediateTable, joinColumn,
              otherColumn, createJoinTable, **attrs):
     self.name = name
     self.intermediateTable = intermediateTable
     self.joinColumn = joinColumn
     self.otherColumn = otherColumn
     self.createJoinTable = createJoinTable
     self.soClass = self.otherClass = None
     for name, value in attrs.items():
         setattr(self, name, value)
     classregistry.registry(soClass.sqlmeta.registry).addClassCallback(
         join, self._setOtherClass)
     classregistry.registry(soClass.sqlmeta.registry).addClassCallback(
         soClass.__name__, self._setThisClass)
Ejemplo n.º 9
0
 def __init__(self, soClass, name, join,
              intermediateTable, joinColumn, otherColumn,
              createJoinTable, **attrs):
     self.name = name
     self.intermediateTable = intermediateTable
     self.joinColumn = joinColumn
     self.otherColumn = otherColumn
     self.createJoinTable = createJoinTable
     self.soClass = self.otherClass = None
     for name, value in attrs.items():
         setattr(self, name, value)
     classregistry.registry(
         soClass.sqlmeta.registry).addClassCallback(
         join, self._setOtherClass)
     classregistry.registry(
         soClass.sqlmeta.registry).addClassCallback(
         soClass.__name__, self._setThisClass)
Ejemplo n.º 10
0
 def __init__(self, name=None, debug=False, debugOutput=False,
              cache=True, style=None, autoCommit=True,
              debugThreading=False, registry=None):
     self.name = name
     self.debug = debug
     self.debugOutput = debugOutput
     self.debugThreading = debugThreading
     self.cache = CacheSet(cache=cache)
     self.doCache = cache
     self.style = style
     self._connectionNumbers = {}
     self._connectionCount = 1
     self.autoCommit = autoCommit
     self.registry = registry or None
     classregistry.registry(self.registry).addCallback(
         self.soClassAdded)
     registerConnectionInstance(self)
     atexit.register(_closeConnection, weakref.ref(self))
Ejemplo n.º 11
0
 def __init__(self,
              soClass=None,
              otherClass=None,
              joinColumn=None,
              joinMethodName=None,
              orderBy=NoDefault,
              joinDef=None):
     self.soClass = soClass
     self.otherClassName = otherClass
     classregistry.registry(soClass._registry).addClassCallback(
         otherClass, self._setOtherClass)
     self.joinColumn = joinColumn
     self.joinMethodName = joinMethodName
     self.orderBy = orderBy
     if not self.joinColumn:
         # Here we set up the basic join, which is
         # one-to-many, where the other class points to
         # us.
         self.joinColumn = styles.getStyle(self.soClass).tableReference(self.soClass._table)
Ejemplo n.º 12
0
 def __init__(self, name=None, debug=False, debugOutput=False,
              cache=True, style=None, autoCommit=True,
              debugThreading=False, registry=None,
              logger=None, loglevel=None):
     self.name = name
     self.debug = Boolean(debug)
     self.debugOutput = Boolean(debugOutput)
     self.debugThreading = Boolean(debugThreading)
     self.debugWriter = makeDebugWriter(self, logger, loglevel)
     self.doCache = Boolean(cache)
     self.cache = CacheSet(cache=self.doCache)
     self.style = style
     self._connectionNumbers = {}
     self._connectionCount = 1
     self.autoCommit = Boolean(autoCommit)
     self.registry = registry or None
     classregistry.registry(self.registry).addCallback(self.soClassAdded)
     registerConnectionInstance(self)
     atexit.register(_closeConnection, weakref.ref(self))
Ejemplo n.º 13
0
 def __init__(self,
              creationOrder,
              soClass=None,
              otherClass=None,
              joinColumn=None,
              joinMethodName=None,
              orderBy=NoDefault,
              joinDef=None):
     self.creationOrder = creationOrder
     self.soClass = soClass
     self.joinDef = joinDef
     self.otherClassName = otherClass
     classregistry.registry(soClass.sqlmeta.registry).addClassCallback(
         otherClass, self._setOtherClass)
     self.joinColumn = joinColumn
     self.joinMethodName = joinMethodName
     self._orderBy = orderBy
     if not self.joinColumn:
         # Here we set up the basic join, which is
         # one-to-many, where the other class points to
         # us.
         self.joinColumn = styles.getStyle(
             self.soClass).tableReference(self.soClass.sqlmeta.table)