Author: phd
Date: 2005-01-15 17:00:08 +0000 (Sat, 15 Jan 2005)
New Revision: 551
Modified:
home/phd/SQLObject/inheritance/sqlobject/main.py
Log:
Emulated basestring for Python 2.2.
Modified: home/phd/SQLObject/inheritance/sqlobject/main.py
===================================================================
--- home/phd/SQLObject/inheritance/sqlobject/main.py 2005-01-15 14:32:28 UTC (rev 550)
+++ home/phd/SQLObject/inheritance/sqlobject/main.py 2005-01-15 17:00:08 UTC (rev 551)
@@ -1330,6 +1330,11 @@
return '_SO_val_%s' % name
+try:
+ basestring
+except NameError: # Python 2.2
+ basestring = (types.StringType, types.UnicodeType)
+
class SelectResults(object):
def __init__(self, sourceClass, clause, clauseTables=None,
@@ -1341,7 +1346,7 @@
tablesDict = sqlbuilder.tablesUsedDict(self.clause)
tablesDict[sourceClass._table] = 1
orderBy = ops.get('orderBy')
- if orderBy and type(orderBy) <> type(''):
+ if orderBy and not isinstance(orderBy, basestring):
tablesDict.update(sqlbuilder.tablesUsedDict(orderBy))
#DSM: if this class has a parent, we need to link it
#DSM: and be sure the parent is in the table list.
|