AlterEgo
old web2py blog
Useful Links
List all entries
Book
Interactive Examples
F.A.Q.
Free Applications
Plugins
Recipes
Demo of Admin Interface
Semantic web extension
Some of the information here may be outdated, please check the book instead
Edit page
Title:
Security Code:
Body:
(use
this
wiki markup)
Many people ask if they can use the web2py Database Abstraction Layer without using the framework. Yes, this is possible, assuming you have the proper database drivers (psycopg2 for PostgreSQL, mysqldb for MySQL, cs_oracle for Oracle, pyodbc for MSSQL, DB2, FireBird) - Download the web2py source - Move the gluon folder into the Python/lib/site-packages folder - use it Example: from gluon.sql import DAL, Field db=DAL('postgres://username:password@localhost/database') db.define_table('friend',Field('name')) print db.tables db.field.insert(name='Tim') print db.friend.fields for row in db().select(db.friend.name,orderby=db.friend.name): print row.name You can also use it in the google app engine db=DAL('gae') [read more](/examples/default/dal) [download code](http://www.web2py.com/appliances/default/download/app.source.a81f7c9a-78b2-46b7-9d4f-666bfa8ddbe2.tar)
© 2008-2010 by Massimo Di Pierro - All rights reserved - Powered by
web2py
- design derived from a theme by
the earlybird
The content of this book is released under the
Artistic License 2.0
- Modified content cannot be reproduced.