SQLObject - Connect to established DB with non-int 'id' field

S

Sean DiZazzo

Hi all,

I am just beginning with TurboGears and have run into a problem with
SQLObject.

I'm trying to connect to an established mysql DB, and use TurboGears
to display results from the DB only. The problem is that the DB
already has an 'id' field that is a string as opposed to an int.
SQLObject complains because it wants to use the id field for it's own
purposes.

How can I use TurboGears to get data out of this DB?

Thanks in advance.

~Sean
 
D

Diez B. Roggisch

Sean said:
Hi all,

I am just beginning with TurboGears and have run into a problem with
SQLObject.

I'm trying to connect to an established mysql DB, and use TurboGears
to display results from the DB only. The problem is that the DB
already has an 'id' field that is a string as opposed to an int.
SQLObject complains because it wants to use the id field for it's own
purposes.

How can I use TurboGears to get data out of this DB?

http://sqlobject.org/FAQ.html#non-integer-ids

While I personally prefer SQLObject over SQLAlchemy, the latter has
better legacy-database-support. Maybe a switch would be the better solution.

Diez
 
P

Pradeep Jindal

Hi all,

I am just beginning with TurboGears and have run into a problem with
SQLObject.

I'm trying to connect to an established mysql DB, and use TurboGears
to display results from the DB only. The problem is that the DB
already has an 'id' field that is a string as opposed to an int.
SQLObject complains because it wants to use the id field for it's own
purposes.

How can I use TurboGears to get data out of this DB?

Thanks in advance.

~Sean
I know I am not exactly answering your question, but its much better to use
sqlalchemy when you already have the databases setup. And especially when you
can not make any changes to existing database schemas.

- Pradeep
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

SQLObject 1.0.0 0
SQLObject 0.13.0 0
SQLObject 0.12.0 0
SQLObject 0.7.8 0
SQLObject 0.10.0b1 0
SQLObject 0.7.7 0
SQLObject 0.8.0 0
SQLObject 0.9.1 0

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,681
Members
48,796
Latest member
Greg L.

Latest Threads

Top