From: Ian B. <ia...@co...> - 2004-09-22 15:49:48
|
I kind of put 0.6 out just so it was there, especially since it has some small but pervasive API changes, and to give people a chance to move over to that. And it's just been too long. My short-term goals from here: * Integrate some of the patches that are out there. Indexing, distinct, and maybe a couple others. I'll look on SourceForge for the patches; if there's something that's not there that you'd like me to look at, it would probably be good to add it there. * Introduce a sqlmeta object; this is going to be a companion object for SQLObject instances, that will contain metadata, and provide a good introspection interface. Class definitions will start to look like: class MyClass(SQLObject): class sqlmeta: table = 'my_class_table' ... aColumn = StringCol() And so on. The sqlmeta class definition will be kind of incorrect, as it's just a way of passing parameters; when you access aMyClass.sqlmeta you'll get getting a subclass of sqlobject.SQLMeta; but they'll be a parrallel, in that the parameters you set (or can set) in the constructor will be available in the sqlmeta instance. I'll be more careful about read-only attributes and the sort, so this should be a good introspection interface. And we'll get rid of all the leading underscores (_table, _connection, etc). * Make *Col objects into descriptors. This is mostly an internal change, but I hope to simplify the SQLObject class significantly. * Col objects will be definable as classes, like: class MyClass(SQLObject): class aColumn(StringCol): dbName = 'ABadColumnName' def get(self, dbGetter): value = dbGetter() return value.lower() And so on. This is where things like onDelete can go, and just a general place to hang hooks. This will be equivalent to: class MyClass(SQLObject): aColumn = StringCol(dbName='ABadColumnName', get=lambda self, dbGetter: dbGetter().lower()) And the current form won't be deprecated in any way (it'll usually be easier to type anyway), but the class form will be more comfortable when you're doing things like adding methods to a column. Anyway, that's the order I'm thinking of tackling things in. I've been actively wanting to do these things for the last week or two, but I didn't want to mess with things before making an 0.6 release, since it was overdue and I didn't want to destabalize the code. I forget that it's really not that hard to make a release. Hopefully between these steps I'll make more releases. Cheers, Ian |