i am a sqlalchemy user and i think most of us are using object mapping instead. i've been using pylons but really tried of the lack of document, and i really enjoy the all in one package advantage in web2py. will web2py give us an option to use sqlalchemy instead of web2py's DAL soon?
-vinc On 11月17日, 下午11時12分, mdipierro <[EMAIL PROTECTED]> wrote: > - The Table must have an integer field called 'id'. > > - ForeignKey must always reference such field. > > - Many SQLAlchemey field attributes are ignored. > > - It does not check for errors. > > - This is not the recommended way to use web2py. This is designed to > lower the entry barrier for current SQLAlchemy users and to > acknowledge the importance of SQLAlchemy within the Python community. > > Massimo > > On Nov 16, 10:36 pm, mdipierro <[EMAIL PROTECTED]> wrote: > > > ** This is incomplete and to be considered a proof of concept ** > > > 1) download > > >http://groups.google.com/group/web2py/web/sqlalchemy.py > > > 2) import it in your app and try the following model: > > > db=SQLDB() > > metadata=MetaData(db) > > > users = Table('users', metadata, > > Column('id', Integer), > > Column('name', String(40)), > > Column('age', Integer), > > Column('password', String), > > Column('blob1',Binary), > > ) > > > dogs = Table('dogs', metadata, > > Column('id', Integer), > > Column('name', String(40)), > > Column('owner', ForeignKey('users.id')), > > ) > > > print users.fields > > print dogs.fields > > > 3) click on [database administration] to see the generated interface. > > > As in the Django cases, the above code defines tables 'users' and > > 'dogs'. They are web2py tables so you can do: > > > id=users.insert(name='Test') > > dogs.insert(name='Snoopy',owner=id) > > for row in db(dogs.owner==users.id).select(): print > > row.dogs.name,row.users.name > > > Massimo --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~----------~----~----~----~------~----~------~--~---

