[storm] Dynamically changing OR mapping question with aliases

Gustavo Niemeyer gustavo at niemeyer.net
Thu Aug 9 17:01:08 BST 2007


Hey Akira,

> I have to use PostgreSQL Schemas for separating language tables, using 
> my mapped class, I can reassign the "__storm_table__" value to reflect 
> the schema that I´ll like to act on.

You say that you can reassign it, but I don't understand the reason
to do so. Can you describe what you're actually trying to perform
and why?

> Link.__storm_table__ ="links"
>
> checking up however:
> print all.__storm_table__
> print Link.__storm_table__
> 
> gives me:
> _1
> links

Right, that looks expected.  The first is the automatic alias
name, since you didn't provide one, and the second is the table
name you just assigned to that attribute.

> Does the reassignment cascade to the table aliases?

Nope. No magic is happening. It's just an attribute assignment.

> Why does it just return the index number( the number increase per 
> created alias) instead of the real table name?

The real class has the real table name, while the alias class
has the alias table name.

> Is this the proper way to do this?

To do what? :-)

-- 
Gustavo Niemeyer
http://niemeyer.net



More information about the storm mailing list