|
|
3 User(s) Active on Site 232 Wiki Pages Most Recently Modified
Meeting SchedulesClub Resources (edit)
How This Wiki Works
Check them out; they are a great source of technical books at very good prices! If you have shopped at Nerdbooks.com, help them out by reviewing them at ResellerRatings.com. You will need your invoice number to prove you are a real customer, and not just ballot stuffing. |
|||
| Recent Changes Printable View Page History Edit Page | |||
|
Content Last Modified on November 12, 2005, at 05:31 AM CST
Installing the PostgreSQL Connector for Zope 3(I have not yet gotten this to work. I first tried the tarball and failed. Now I'm trying the version in the Zope subversion repository, with better luck but still no success.) First, successfully talking to PostgreSQL from Zope 3 involves several layers of software, each of which must be just right to work.
Step 1 - PostgreSQL Server InstanceYou'll need an installed PostgreSQL server someplace, either on your machine or another. The details for this are OS/distribution-specific and won't be covered here. What's important is that you know your connection details:
Step 2 - PostgreSQL Client LibrariesAgain these are OS/distribution-specific but it sometimes is necessary to know the directories in which the (a) link libraries and (b) header files are located. This information is used in step 3 if the automatic build configuration cannot determine these on its own. To find the header files directory, do a file search for "pg_config.h".
[jrush]# locate pg_config.h
To find the link libraries directory, do a file search for "libpq.so":
[jrush]# locate libpq.so
Step 3 - mxDateTime Python PackageVersion 1 of the 'psycopg' database adapter uses a 3rd party date/time module to represent the SQL date type. Therefore, mxDateTime must be installed first. Version 2 of the 'psycopg' database adapter uses the date/time module built into Python and no longer needs mxDateTime. Step 4 - psycopg v1.x'psycopg' is a general-purpose database adapter for talking to PostgreSQL from the Python language and is not specific to Zope. Instructions for installing it are here. Step 5 - PsygopgDAThe package 'psycopgda' (note the trailing DA) is a thin layer over 'psycopg' for hooking it into the Zope 3 component framework. The version of 'psycopgda' to use with Zope 3.1.0 is NOT the tarball but that within the Zope 3 subversion repository. To retrieve it: [jrush]# cd /usr/share/zope-3.1.0/lib/python [jrush]# svn co svn://svn.zope.org/repos/main/psycopgda/trunk psycopgda There is no separate installation step. By placing the package under the Zope installation directory, it will automatically be available to any Zope instances you create from here on. If you already have Zope instances, do the following copy step. To inform Zope 3 that this database adapter is now present, you must copy the file 'psycopg-configure.zcml' into the 'package-includes' directory of your Zope instance. NOTE: Be sure you do not install or use the ZPsycopgDA package from Zope 2. Althought similar is name and function, you cannot mix Zope 2 and Zope 3 packages. Any new Zope instance will now have this package at its disposal. If you want to make the package available to existing Zope 3 instances, you must perform the following sequence of commands: [jrush]# cd ~/zope3 [jrush]# cp lib/python/psycopgda/psycopgda-configure.zcml etc/package-includes/ Step 6 - Zope 3 ConnectorA database connection in Zope 3 is registered as a utility.
|
|||
| Recent Changes Printable View Page History Edit Page | |||