[SQL-CVS] r1458 - home/phd/SQLObject/paramstyles/sqlobject
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
|
From: <sub...@co...> - 2006-01-03 14:05:14
|
Author: phd
Date: 2006-01-03 14:04:19 +0000 (Tue, 03 Jan 2006)
New Revision: 1458
Modified:
home/phd/SQLObject/paramstyles/sqlobject/col.py
Log:
Merged patches from the revisions 1455:1457 from the trunk: merged a patch from rev. 1456: the fix for the bug N 1378359: always call super().__init__().
Modified: home/phd/SQLObject/paramstyles/sqlobject/col.py
===================================================================
--- home/phd/SQLObject/paramstyles/sqlobject/col.py 2006-01-03 14:03:34 UTC (rev 1457)
+++ home/phd/SQLObject/paramstyles/sqlobject/col.py 2006-01-03 14:04:19 UTC (rev 1458)
@@ -128,6 +128,8 @@
origName=None,
extra_vars=None):
+ super(SOCol, self).__init__()
+
# This isn't strictly true, since we *could* use backquotes or
# " or something (database-specific) around column names, but
# why would anyone *want* to use a name like that?
@@ -380,6 +382,7 @@
baseClass = SOCol
def __init__(self, name=None, **kw):
+ super(Col, self).__init__()
self.__dict__['_name'] = name
self.__dict__['_kw'] = kw
self.__dict__['creationOrder'] = creationOrder.next()
@@ -429,7 +432,7 @@
elif self.varchar == 'auto':
self.varchar = True
- SOCol.__init__(self, **kw)
+ super(SOStringLikeCol, self).__init__(**kw)
def autoConstraints(self):
constraints = [consts.isString]
@@ -718,7 +721,7 @@
kw['origName'] = kw['name']
if not kw['name'].upper().endswith('ID'):
kw['name'] = style.instanceAttrToIDAttr(kw['name'])
- SOKeyCol.__init__(self, **kw)
+ super(SOForeignKey, self).__init__(**kw)
def postgresCreateSQL(self):
sql = SOKeyCol.postgresCreateSQL(self)
@@ -812,7 +815,7 @@
baseClass = SOForeignKey
def __init__(self, foreignKey=None, **kw):
- KeyCol.__init__(self, foreignKey=foreignKey, **kw)
+ super(ForeignKey, self).__init__(foreignKey=foreignKey, **kw)
class SOEnumCol(SOCol):
@@ -820,7 +823,7 @@
self.enumValues = popKey(kw, 'enumValues', None)
assert self.enumValues is not None, \
'You must provide an enumValues keyword argument'
- SOCol.__init__(self, **kw)
+ super(SOEnumCol, self).__init__(**kw)
def autoConstraints(self):
return [consts.isString, consts.InList(self.enumValues)]
@@ -959,7 +962,7 @@
datetimeFormat = popKey(kw, 'datetimeFormat')
if datetimeFormat:
self.datetimeFormat = datetimeFormat
- SOCol.__init__(self, **kw)
+ super(SODateTimeCol, self).__init__(**kw)
def createValidators(self):
_validators = super(SODateTimeCol, self).createValidators()
@@ -1024,7 +1027,7 @@
def __init__(self, **kw):
dateFormat = popKey(kw, 'dateFormat')
if dateFormat: self.dateFormat = dateFormat
- SOCol.__init__(self, **kw)
+ super(SODateCol, self).__init__(**kw)
def createValidators(self):
"""Create a validator for the column. Can be overriden in descendants."""
@@ -1082,7 +1085,7 @@
timeFormat = popKey(kw, 'timeFormat')
if timeFormat:
self.timeFormat = timeFormat
- SOCol.__init__(self, **kw)
+ super(SOTimeCol, self).__init__(**kw)
def createValidators(self):
_validators = super(SOTimeCol, self).createValidators()
@@ -1166,7 +1169,7 @@
self.precision = popKey(kw, 'precision', NoDefault)
assert self.precision is not NoDefault, \
"You must give a precision argument"
- SOCol.__init__(self, **kw)
+ super(SODecimalCol, self).__init__(**kw)
def _sqlType(self):
return 'DECIMAL(%i, %i)' % (self.size, self.precision)
@@ -1183,7 +1186,7 @@
def __init__(self, **kw):
pushKey(kw, 'size', 10)
pushKey(kw, 'precision', 2)
- SODecimalCol.__init__(self, **kw)
+ super(SOCurrencyCol, self).__init__(**kw)
class CurrencyCol(DecimalCol):
baseClass = SOCurrencyCol
@@ -1279,7 +1282,7 @@
def __init__(self, **kw):
self.pickleProtocol = popKey(kw, 'pickleProtocol', 1)
- SOBLOBCol.__init__(self, **kw)
+ super(SOPickleCol, self).__init__(**kw)
def createValidators(self):
return [PickleValidator(
|