SQL backed content types
What you need
- PostgreSQL setup with the world sample database from http://pgfoundry.org/projects/dbsamples/
- Plone 3.0
- SQLAlchemy 0.4.x (currently only in svn)
- collective.lead (svn trunk)
- collective.mercury (svn trunk)
Aims
- Content types should be workflowable
- No stub objects in ZODB (though content should be catalogued)
- All rows for a table are accessible through a single folder (content cannot be placed anywhere on the site)
Setting up the database
postgres=# create database world with owner plone encoding 'UTF8';
$ psql -d world -f world.sql
Creating our Product
$ mkdir Products/World
$ ./bin/zopectl debug
Starting debugger (the name "app" is bound to the top-level Zope object)
>>> from collective.mercury import codegen
>>> codegen.create_files('Products/World', overwrite=True, annotate=False, drivername='postgres',
... database='world', username='plone', password='plone', host='localhost')
In the products directory should be a folder named World with three files: db.py, autointerfaces.py and automodel.py.
Now create
