On Mon, Dec 20, 2004 at 11:01:49AM +1300, Peter Butler wrote:
> initStrings.append('%s = self.%s' % (col.name,
> col.name))
> allAttrs.remove(col.name)
> removeAttrs.append(col.name)
> elif col.default is not None and col.default !=
> sqlobject.sqlbuilder.NoDefault:
> initStrings.append("%s = %s" % (col.name,
> `col.default`))
> else:
> initStrings.append('%s = None' % (col.name))
> initString = '%s(%s)' % (self.clazz.__name__,
> string.join(initStrings, ','))
> self.object = eval(initString)
Wow! That's a long and a very wrong way of doing things. This is
Python! Do not evaluate strings - just manipulate objects.
args = ["arg1", 2, 3.0]
keywords = {"name1": "valu1", "name2": "value2"}
self.object = self.clazz(*args, **kywords)
Oleg.
--
Oleg Broytmann http://phd.pp.ru/ ph...@ph...
Programmers don't die, they just GOSUB without RETURN.
|