[sqlalchemy] Re: pass any field as a keyword param to the constructor?

2009-11-29 Thread Lukasz Szybalski
I guess the proper solution is to setup your python class mapper like this, and use the update method of the __dict__ instead of setattr. class Recall(object): def __init__(self, **kw): self.__dict__.update(kw) pass Lucas On Thu, Nov 26, 2009 at 3:24 PM, Lukasz Szybalski

Re: [sqlalchemy] Re: pass any field as a keyword param to the constructor?

2009-11-29 Thread Michael Bayer
On Nov 29, 2009, at 2:17 PM, Lukasz Szybalski wrote: I guess the proper solution is to setup your python class mapper like this, and use the update method of the __dict__ instead of setattr. class Recall(object): def __init__(self, **kw): self.__dict__.update(kw) pass if

Re: [sqlalchemy] Re: pass any field as a keyword param to the constructor?

2009-11-29 Thread Lukasz Szybalski
On Sun, Nov 29, 2009 at 3:58 PM, Michael Bayer mike...@zzzcomputing.com wrote: On Nov 29, 2009, at 2:17 PM, Lukasz Szybalski wrote: I guess the proper solution is to setup your python class mapper like this, and use the update method of the __dict__ instead of setattr. class Recall(object):

Re: [sqlalchemy] Re: pass any field as a keyword param to the constructor?

2009-11-29 Thread Michael Bayer
On Nov 29, 2009, at 7:24 PM, Lukasz Szybalski wrote: On Sun, Nov 29, 2009 at 3:58 PM, Michael Bayer mike...@zzzcomputing.com wrote: On Nov 29, 2009, at 2:17 PM, Lukasz Szybalski wrote: I guess the proper solution is to setup your python class mapper like this, and use the update method

[sqlalchemy] Re: pass any field as a keyword param to the constructor?

2009-11-26 Thread Lukasz Szybalski
Any idea how should I be set the None Type argument to str.? x=Recall() type(x.MAKETXT) is type 'NoneType' set in OrmObject when it does the setattr it probably fails because you cannot setattr on NoneType objects? setattr(x.MAKETXT,'somevalue') Traceback (most recent call last): File stdin,