> Its not *currently* possible, however I don't think it would be hard
> at all to put in something like this into ActiveMapper:

Well, that was easy.  Check out revision 1708.  It lets you do the
following:

     from sqlalchemy.ext.activemapper import *
     import sqlalchemy.ext.activemapper as activemapper

     activemapper.metadata.connect('connect:///string')

     class Person(ActiveMapper):
         class mapping:
             __autoload__ = True

     if __name__ == '__main__':
         import sys
         person_name = sys.argv[1].upper() + '%'

         people = Person.select(Person.c.name.like(person_name))
         print '=' * 80
         for person in people:
             print person.name
             print '=' * 80

Note that you absolutely *must* have the activemapper metadata bound
before you declare your classes, or everything will blow up.  It does
not yet support relationships (and might not ever, from what Mike
stated in his response to me earlier in the thread).

Give it a whirl, and let me know if it works for you.

--
Jonathan LaCour
http://cleverdevil.org


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Sqlalchemy-users mailing list
Sqlalchemy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users

Reply via email to