Benjamin Scherrey wrote:
Anyone checked out the 'Ruby with Rails' ( http://www.rubyonrails.com ) project? I've not yet played around with it but their mechanism of definging a seemingly seemless object-relational mapping (the Active Record aspect of the project) from within the language is really promising. From what I've seen, their use of reflection to implement this doesn't seem outside of good python programming practice and, I believe, python should be fully capable of supporting a similar construct without modifying the existing language.

Someone's working on it: http://subway.python-hosting.com/

SQLObject, which is what Subway is using, is fairly similar to ActiveRecord. This is what you do to create a class with attributes read from the database:

from sqlobject import SQLObject
class MyTable(SQLObject):
    _connection = 'mysql://user:[EMAIL PROTECTED]/dbname'
    _fromDatabase = True

--
Ian Bicking  /  [EMAIL PROTECTED]  /  http://blog.ianbicking.org
_______________________________________________
DB-SIG maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/db-sig

Reply via email to