[Zope3-Users] newbie database adapter questions

Maciej Wisniowski maciej.wisniowski at coig.katowice.pl
Fri Feb 2 06:33:11 EST 2007


> It seems like most of the examples only explain how to create forms by
> using interfaces and objects.  
I've noticed this too.

> I don't want a user within zope to create a form in the ZODB, I just
> want to them to open up a location to url and see results from my
> database.  
Currently I'm doing something like that. It it supposed to work this way:
1. You enter url like
http://localhost:8080/manage_customer_form?in.customer_id=23
2. Form is displayed that contains data from underlying RDBMS
3. If you want another customer then you need to change in.customer_id
parameter value

There also other possiblities, eg. "Container/Folder that contains
object from a database.
The container is persistent.  The container however loads the content
from an SQL database"
This is from David Johnson post to this list at: 2007.01.26 in thread:
"Access to request in content object and object path in doctests". David
declared that
he may share his code but so far I don't have it. I'll try to remind him.


My implementation is like:

I've created content object that has two functions:
1. to get data from RDBMS (but this is not necessarily RDBMS)
2. to store data to RDBMS
Typically these functions will do 'select ... from' and 'update ...'

Then I've attached formlib view based on FormBase to this content object.
My setUpWidgets function gets input parameters from request, passes
them to get_data function of content object to receive data from RDBMS
and then uses setUpDataWidgets to set up widgets. Save action causes
to save_data function to be called.
There are some drawbacks, eg. you need to remember input parameters
somewhere etc.

My code is not ready yet but should be soon.
I'll try to publish it somwhere if somebody is interested.

-- 
Maciej Wisniowski


More information about the Zope3-users mailing list