[storm] Dynamically changing OR mapping question with aliases
akira
nhytro-python at web.de
Thu Aug 9 18:26:42 BST 2007
Another thing, why was the name automatic? I assigned a name to it like
this:
all = ClassAlias(Link)
besides, I wanted to retrieve the table thats its mapped to not the
internal name of the alias, this seems very strange.
Gustavo Niemeyer wrote:
> 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? :-)
>
>
More information about the storm
mailing list