[SQL-CVS] r850 - trunk/SQLObject/sqlobject
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: <sub...@co...> - 2005-07-21 07:11:41
|
Author: ianb Date: 2005-07-21 07:11:36 +0000 (Thu, 21 Jul 2005) New Revision: 850 Modified: trunk/SQLObject/sqlobject/joins.py trunk/SQLObject/sqlobject/main.py Log: Moved _SO_perConnection to sqlmeta Modified: trunk/SQLObject/sqlobject/joins.py =================================================================== --- trunk/SQLObject/sqlobject/joins.py 2005-07-21 07:11:20 UTC (rev 849) +++ trunk/SQLObject/sqlobject/joins.py 2005-07-21 07:11:36 UTC (rev 850) @@ -127,7 +127,7 @@ self.otherClass, self.joinColumn, inst.id) - if inst._SO_perConnection: + if inst.sqlmeta._perConnection: conn = inst._connection else: conn = None @@ -180,7 +180,7 @@ self.otherColumn, self.joinColumn, inst.id) - if inst._SO_perConnection: + if inst.sqlmeta._perConnection: conn = inst._connection else: conn = None Modified: trunk/SQLObject/sqlobject/main.py =================================================================== --- trunk/SQLObject/sqlobject/main.py 2005-07-21 07:11:20 UTC (rev 849) +++ trunk/SQLObject/sqlobject/main.py 2005-07-21 07:11:36 UTC (rev 850) @@ -182,6 +182,9 @@ # left. _creating = False _obsolete = False + # Sometimes an intance is attached to a connection, not + # globally available. In that case, self.sqlmeta._perConnection + # will be true. It's false by default: _perConnection = False def __classinit__(cls, new_attrs): @@ -274,11 +277,6 @@ __metaclass__ = declarative.DeclarativeMeta - # Sometimes an intance is attached to a connection, not - # globally available. In that case, self._SO_perConnection - # will be true. It's false by default: - _SO_perConnection = False - _connection = sqlhub _columns = [] @@ -827,7 +825,7 @@ # Sometimes we need to know if this instance is # global or tied to a particular connection. # This flag tells us that: - self._SO_perConnection = True + self.sqlmeta._perConnection = True if not selectResults: dbNames = [col.dbName for col in self.sqlmeta._columns] @@ -1045,7 +1043,7 @@ def _SO_foreignKey(self, id, joinClass): if id is None: return None - elif self._SO_perConnection: + elif self.sqlmeta._perConnection: return joinClass.get(id, connection=self._connection) else: return joinClass.get(id) @@ -1060,7 +1058,7 @@ # Pass the connection object along if we were given one. if kw.has_key('connection'): self._connection = kw['connection'] - self._SO_perConnection = True + self.sqlmeta._perConnection = True del kw['connection'] self._SO_writeLock = threading.Lock() |