"一首诗" <[EMAIL PROTECTED]> writes:

> Question 1.
> ~~~~~~~~~
> For some histronic problem, my turbogear program have to fetch data
> from 2 different database.
>
> So my question is, does turbogear have some built-in mechanisms to
> solve this problem?

It depends on the ORM you'll use.  You can do that with SQL Object, for
example.

Create two connections, assign each class to the right connection and then
just use it.

If you have tables with the same name you'll have to create different classes
and correct their table names. 

You can also specify which connection to use per statement. 

Take a look at the docs for your own ORM (an example for SQL Object is "pydoc
sqlobject.SQLObject.select", see the 'connection' parameter).

> Question 2.
> ~~~~~~~~~
> I have a col defined like this:
>
> class MyClass(SQLObject):
>     Name = UnicodeCol(alternateID=True, length=20, dbEncoding='gb2312')
>
> ....
>
> name = u'天下无敌'  #some chinese character
> found = MyClass.byName(name)  # This caused an exception that looks
> like that there is some encoding problem.
>
> Fetching data from the db with MyClass.get(id) works fine, even if Name
> field does contain Chinese Characters,  but I cannot search by this
> Column.
>
> How can I fix this problem?

Have you read past threads related to MySQL + SQLObject ?

-- 
Jorge Godoy      <[EMAIL PROTECTED]>

--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to