[storm] Dynamically changing OR mapping question with aliases
Stuart Bishop
stuart.bishop at canonical.com
Sat Aug 11 05:24:53 BST 2007
akira wrote:
> Ok, I´ll explain again :-) I have to develop a multilingual site, all
> the content and link are coming from tables that I have separated by
> language into schemas
> example:
>
> en.content # table for English content
> de.content # table for German content
>
> so depending on what the user chooses, the right database would be
> chosen and consecutively the right data would be displayed, I just do:
>
> Link.__storm_table__ = session.userlang
>
> Then I can make queries on the database
>
> was that clear?
>>> Is this the proper way to do this?
It may be much simpler for you to change the search path at the start of the
transaction by issuing the following statement manually:
SET search_path = de,public
You can then just refer to 'Content', and know that on that particular
connection you will be accessing the German content.
--
Stuart Bishop <stuart.bishop at canonical.com> http://www.canonical.com/
Canonical Ltd. http://www.ubuntu.com/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/storm/attachments/20070811/5697af6f/attachment.pgp
More information about the storm
mailing list