this was supposed to go to the mailing list too :)

---------- Forwarded message ----------
From: Jorge Vargas < jorge.vargas@gmail.com>
Date: May 30, 2006 7:03 PM
Subject: Re: [SQLObject] Dynamic class database discovery and foreign keys
To: Toby <toby@rcsreg.com>

On 5/30/06, Toby <toby@rcsreg.com> wrote:
I know about fromDatabase, but that forces me to
know about, and create a class for each table in
my database. 

no it doesn't

 I don't know how I would create these
 
http://www.sqlobject.org/SQLObject.html#class-sqlmeta

you will say something like

class YourClass(SQLObject):
class sqlmeta:
fromDatabase = True

classes on the fly, in response to examination of
the list of tables in the database.

list of tables? umm will you have dinamic table creation? can't you just see which are the tables and write a little script defining the tables?

although you can make dinamic classes created on the fly adding them to the module __dict__ but that seems really esoteric and there should be a better way to do it.

if you plan to have volatile tables I recommnent using sqllite memory tables.

Thanks,

Toby

Oleg Broytmann wrote:
> On Fri, May 26, 2006 at 11:49:01AM -0700, Tobiah wrote:
>> I want use SQLObject in such a way that it discovers
>> my database automatically, and builds classes for each
>> table.  The docs just mention that it can be done, but
>> I'm not exactly sure how.
>
>    If you know the name of the table, just use fromDatabase=True. So you
> only need to list all tables for a database.
>
> Oleg.



-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642
_______________________________________________
sqlobject-discuss mailing list
sqlobject-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss