[DB-SIG] Python with Rails?

Ian Bicking ianb at colorstudy.com
Tue Jan 25 22:49:03 CET 2005


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:passwd@host/dbname'
     _fromDatabase = True

-- 
Ian Bicking  /  ianb at colorstudy.com  /  http://blog.ianbicking.org


More information about the DB-SIG mailing list