Re: [SQLObject] ezSqlObject convenience wrapper
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Ian B. <ia...@co...> - 2004-03-07 21:00:31
|
On Mar 7, 2004, at 11:48 AM, Brad Bollenbach wrote: > On samedi, mars 6, 2004, at 03:17 Canada/Eastern, David McNab wrote: >> I've just put up a module called EzSqlObject, which wraps SQLObject's >> connection, table and results classes, and adds a few conveniences: >> >> * .tables attribute in connection objects, lists out the tables in >> the database >> * .columns attribute in table objects, lists the columns in the table >> * automatic retrieval of existing table structure from database (if >> not provided as a table class) >> * tables of a database available as attributes of connection object >> * Can fetch individual rows from a table or resultset via array index >> * automatic logging >> * dump() method in connection, table and results objects >> * len() works for table and results objects >> * doQuery() method for connection objects > > It doesn't make any sense to create another module for this. As well, > some of these features don't make sense (e.g. I'm not sure what len() > on a table is supposed to tell me [number of columns perhaps?], but > len() on a SelectResults is already done by using the count() method > on an instance.) I actually specifically took out len() support, because it gets called by list() and some other functions implicitly, causing unnecessary database queries. I like wrappers myself, so it's cool by me if it's a separate module. I think tables being attributes of the connection only works for a certain set of applications, so I don't think it belongs as a general SQLObject feature (though maybe, I'm not sure). But yes, I'd be happy to have David add some of these features directly into SQLObject directly. -- Ian Bicking | ia...@co... | http://blog.ianbicking.org |