[storm] Dynamically change __storm_table__ is it possible?

Steve Kieu msh.computing at gmail.com
Wed Mar 30 02:39:07 UTC 2011


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



More information about the storm mailing list