Re: [SQLObject] Finding the names of the tables...

2008-04-14 Thread Oleg Broytmann
On Mon, Apr 14, 2008 at 12:27:55AM -0300, Sam's Lists wrote: > Traceback (most recent call last): > File "samdump.py", line 32, in > for z in x.sqlmeta.asDict(): > TypeError: unbound method asDict() must be called with sqlmeta instance as > first argument (got nothing instead) It seems m

Re: [SQLObject] Finding the names of the tables...

2008-04-13 Thread Sam's Lists
Oleg... Thanks for this I tried your method, but I think you can't dynamically create classes that way. I had some success with this: table_classes = [] i = 0 for table in tables: print i, "-", table[0] y = new.classobj('sqlmeta', (), {'table': table[0], 'fromDatabase': True}) x

Re: [SQLObject] Finding the names of the tables...

2008-04-13 Thread Oleg Broytmann
On Sat, Apr 12, 2008 at 07:31:07PM -0300, Sam's Lists wrote: > So you've given me step one and it works well. Thank you. > > tables = connection.queryAll('show tables') > for table in tables: > print "\t", table[0] > > Now I know step three is something like this: > recdict = record.

Re: [SQLObject] Finding the names of the tables...

2008-04-12 Thread Sam's Lists
Oleg... Thanks for this! I'm just getting back to it now... (For those that don't remember the original message, I want to dump my whole database as text or yaml or json or whateverbasically I'm writing my own mysqldump). So you've given me step one and it works well. Thank you. tables =

Re: [SQLObject] Finding the names of the tables...

2008-03-25 Thread Oleg Broytmann
On Tue, Mar 25, 2008 at 05:24:10PM -0300, Sam's Lists wrote: > My first silly question is how can I, using sqlobject, find the names of > all the tables in my database. > > (A related question...can I find the names of all the databases as well?) There is no way in SQLObject. SO assumes you k