Author: phd
Date: 2004-12-03 14:35:24 +0000 (Fri, 03 Dec 2004)
New Revision: 436
Modified:
home/phd/SQLObject/inheritance/sqlobject/main.py
Log:
Fixed an inconsistency: there are columns that are not in the __class__,
added with addColumn, for example, such as columns from the database.
Modified: home/phd/SQLObject/inheritance/sqlobject/main.py
===================================================================
--- home/phd/SQLObject/inheritance/sqlobject/main.py 2004-12-03 10:54:30 UTC (rev 435)
+++ home/phd/SQLObject/inheritance/sqlobject/main.py 2004-12-03 14:35:24 UTC (rev 436)
@@ -904,9 +904,7 @@
value = toPython(dbValue, self._SO_validatorState)
setattr(self, instanceName(name), value)
for name, value in extra.items():
- try:
- getattr(self.__class__, name)
- except AttributeError:
+ if name not in self._SO_columnDict:
raise TypeError, "%s.set() got an unexpected keyword argument %s" % (self.__class__.__name__, name)
try:
setattr(self, name, value)
@@ -942,9 +940,7 @@
setattr(self, instanceName(name), value)
toUpdate[name] = dbValue
for name, value in extra.items():
- try:
- getattr(self.__class__, name)
- except AttributeError:
+ if name not in self._SO_columnDict:
raise TypeError, "%s.set() got an unexpected keyword argument %s" % (self.__class__.__name__, name)
try:
setattr(self, name, value)
|