[Zope] Zope, PostgreSQL 6.5, and some newbie questions

Michel Pelletier michel@digicool.com
Tue, 15 Jun 1999 17:37:00 -0400


> -----Original Message-----
> From: Cary O'Brien [mailto:cobrien@Radix.Net]
> Sent: Tuesday, June 15, 1999 5:05 PM
> To: zope@zope.org
> Subject: [Zope] Zope, PostgreSQL 6.5, and some newbie questions
> 
> 
> 
> Ok, after fiddling around with zope of a month or so I've finally
> started to build something.  Basically it tracks software/hardware
> bugs/mods in a PostgreSQL backend database.  (I'm using a brand new
> PostgreSQL 6.5 build, which works fine, if anyone cares).
> 
> After a day of coding I've got insert and view pages and a whole 
> bunch of issues/observations/questions.  Here goes.  Sorry it
> is so long.  I've been kind of saving up questions.
> 
> 0) Zope looks awesome.  Time will tell.
> 
> 1) Is there an easy way to see error messages?  Netscape 
> (3.0) won't show
>    me the source of a frame that had an error, so to see the 
> stack trace
>    I need to use lynx and backslash.
> 

Set the BOBO_DEBUG_MODE env variable to 1.  Depending on how your use
Zope, you can add this to your pcgi resource file (Zope.cgi) or you can
run z2.py with BOBO_DEBUG_MODE=1 on the command line.  This will stop
Zope from embeding error values and traceback in HTML comments.

Netscape 3.0?

> 2) I want a basic view table/edit/update/delete interface to 
> the underlying
>    tables.  The Z Search interface + Z SQL method woks ok for 
> queries but doesn't
>    provide much support for edits/deletes.  Am I missing something or
>    do I have to roll my own forms?

You have to roll your own forms.  But you might want to look into
Anthony Baxters dataminer tool.

http://www.interlink.com.au/anthony/dmcdemo.html

> 
> 3) In order to keep the DTML uncluttered, I've created dtml 
> methods to render
>    things like HTML selections.  Two questions.: First, how 
> do I access them
>    if I move them to a subfolder in the same folder as the 
> dtml document?
>    Second, how do I pass parameters to the dtml methods?
> 

If you put them in a subfolder you can:

<!--#var "folder.method()"-->

and passing parameters:

<!--#var "folder.method(var1, var2)"-->

Putting methods in a subfolder is also useful if they are very
*specific* methods, but it is also useful to put very *general* methods
*above* where you want to call them, and then just let Acquisition find
them and call them.

> 4) Can Z SQL methods return anything?  After an insert I'd like to get
>     some more information.

Uhm.. I'll let someone else answer this one! (show's off my SQL
ignorance)
> 
> 5) I've got the select (easy) and insert (too much typing!) 
> working, next I 
>    need to do an update.  For this I need to do a select 
> using a key, get
>     the current values of the row, set all the text areas and 
> selects to the
>    current values, render the form, and then set up the 
> target dtml document
>    to do the update.  Is there an example of this anywhere?  
> Or a product to
>    do it automagically?
> 

Same as your last question. ;)

> 6) How the heck do I set up a back button.  PARENTS[1] 
> doesn't seem to do it.

Uhm, need more info here.  Back from where to what?  If your in a DTML
Method, PARENTS[1] is the folder that *contains* the folder that
contains your method.  Remember, Methods are not 'objects' like other
Zope objects (well they are object, but they're method objects ;),
everything from a DTML Methods perspective is from the perspective of
the folder than contains the method.  So, PARENTS[0] is the Folder than
contains the method that has the expression:

<!--#var "PARENTS[0]"-->

But even that's not *entirely* useful to you, because this is rendered
as:

<Folder instance at 0x848f910>

PARENTS[0] is the Folder *object*.

Perhaps your looking for:

<!--#var URL1-->

-Michel



> 
> Thanks in advance,
> 
> -- cary
> 
> Cary O'Brien
> 
> 
> 
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://www.zope.org/mailman/listinfo/zope
> 
> (For developer-specific issues, use the companion list,
> zope-dev@zope.org - http://www.zope.org/mailman/listinfo/zope-dev )
>