hi petr... wanted to say thanks for your assistance/pointers...
i managed to create a quick test that illustrates a method of using a string "id" for a tbl, as opposed to the "auto generated" int that is normally required. i'm including the sample sql that i used to create the test database (mysql) as well as the short chunk of test python to implement the string 'id' for the table... might be useful to someone else!!! =================================================== test sql /* # # test the sqlobject app # */ drop database if exists jfrank3; create database jfrank3; use jfrank3; DROP TABLE IF EXISTS test; CREATE TABLE test ( id varchar(15) NOT NULL default '', aa varchar(5) default '', id2 varchar (20) default '', PRIMARY KEY (id) ) TYPE=MyISAM DEFAULT CHARSET=latin1; DROP TABLE IF EXISTS test2; CREATE TABLE test2 ( id varchar(15) NOT NULL default '', aa2 varchar(5) default '', primary key(id) ) TYPE=MyISAM DEFAULT CHARSET=latin1; ======================================================== test python #!/usr/bin/python # # test sqlobject # # from sqlobject import * import sys, os print "foo \n" t1 = 'mysql://lab:[EMAIL PROTECTED]/jfrank3' sqlhub.processConnection = connectionForURI(t1) print "end foo \n" class foo(SQLObject): class sqlmeta: table = 'test' idName='id' idType=str aa =StringCol(length=5) id2 =StringCol(length=20) tmp=foo(id="11eaad", aa='qqq', id2='ffff') tmp2=foo.selectBy(aa='qqq') ### ### the previous line does a "select * from where" so it ### might return multiple lines... ### in order to print the tmp array needs to be set to a ### valid array ndx... or you can simply use some kind of ### a loop!!! (this is just a test!!!) ### #qq=tmp2[4] print qq.id, "-- ", qq.aa print "mmmmmm \n" -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Petr Jakeš Sent: Sunday, December 30, 2007 2:20 PM To: bruce Cc: sqlobject-discuss@lists.sourceforge.net Subject: Re: [SQLObject] sqlobject - python question/issue Thanks for the replies.. In my case, the ID is used to store a generated uuid, as a completely unique string. The overall process, is that I have multiple systems, and they each run a local process, with a local db/tbl structure.. I then reconcile all the processes on a centralized mysql db process at a later time.. My process enforces that the ID is essentually unique across all my systems. I don't want to change this approach. Nor do I simply want to have an ID that's an int, simply to use SQLObject... So.. my goal is to be able to use sqlobject to interface with the existing mysql db/tbl, and to be able to modify/handle an id that's a string... So what is the problem? simply connect to both tables, (the Source table and the Target table) using two different connections. class Source(SQLObject): class sqlmeta: fromDatabase = True idName = "SOURCE_TABLE_ID_NAME" idType= str class Target(SQLObject): class sqlmeta: fromDatabase = True idName = "TARGET_TABLE_ID_NAME" idType= str and read data from Source and write it to Target (as you can see in my previous posting). I am not sure about the performance, but I think it must work. Alternatively you can export a .csv file from the Source table (using SQLobject of course) and than import it to the to the Target table (here is use of the SQLobject not recommended because of the performance issue). Petr Jakes ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ sqlobject-discuss mailing list sqlobject-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss