I guess I am out of luck then I have tried to use setattr(AccessLog, '__storm_table__', 'table-name') which get rid of the error. However I can only set it once. Reset it to another value will not work, it still pointing to the old one.
As it is class attribute <sigh> On Wed, Mar 30, 2011 at 12:39 PM, Steve Kieu <[email protected]> wrote: > Hello everyone, > > I got a situation that I would like to dynamically change the table > that a class mapped to when I make the object in constructor. > > Example like this > > class AccessLog(Storm): > # Instead of declaring here, move it to constructor as table name is dynamic > # __storm_table__ = "data1" > > def __init__(self, tabname): self.__storm_table__ = tabname > > but it does not work as when I assign value to other property and I got > > <class '__main__.AccessLog'>.__storm_table__ missing > > Many thanks > > Cheers > > -- > Steve Kieu > -- Steve Kieu -- storm mailing list [email protected] Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/storm
