เมนูนำทาง เรื่อง

Pylons + Elixir

I use Pylons and Elixir from trunk (both). Paster create -t pylons … generate most of code for SQLAlchemy so in order to use Elixir, I just made small modification following http://cleverdevil.org/computing/68/ and http://elixir.ematia.de/trac/wiki/TutorialDivingIn. In the example, meta.py has not been modified but I try to modify meta.py too. Also I put a lot of thing in function “init_model”. I don’t know whether these will casue problems … but as least, it works with a small example :-P.

In my example, the project name is “mydb4”. Firstly, I modified mydb4/model/meta.py:

engine = None

Secondly, mydb4/model/__init__.py was modfied. In this file, I put also the class Person, which declares the table in the database.

At the shell, command “paster setup-app development.ini” was called, then it created database correctly. After database was created, data are insert into table manually by “sqlite3 development.db” … then