[Zope] Newbie questions

Dieter Maurer dieter at handshake.de
Mon Dec 1 13:47:57 EST 2003


fowlertrainer at anonym.hu wrote at 2003-12-1 10:38 +0100:
 > 1.)
 >  I cannot show results of Z-SQL method.
 > 
 >  I see the examples on web, on tutorial, but...
 > 
 >  ZSQL method name: testgroup.
 > ...
 >  But no result.
 > ... in template ...

Add a "Z Search Interface" for your Z SQL Method (via the "Add list").
Adjust the generated "report page" as needed.

Note that the batching links for the generated ZPT "report page" 
are broken. I posted a patch to the mailing list (may be a bit
difficult to find; search for "url_query").

 > 2.)
 >  I want to process the result of zsql query under PythonScript (select
 >  * from xxx).

Please read the respective chapter in the Zope Book (online 2.6 edition).

 > 3.)
 >  There is an (K)InterBase Connection.
 >  I want to access the IB specials.
 > 
 >  These are:
 >         - start transaction/Commit/Rollback, more if possible

This is done automatically for you (transactions are tied to
Zope's requests).

 >         - call stored procs

Many DA's support a "callproc" method. Check whether your DA
belongs to this class.

 >         - set the transactions isolation level

The default set by the DA should be "serialized".

I fear, you will need to change its code when you want something
else.

 > 4.)
 >  If there are two requests in zope, and the scripts are have
 >  use (K)InterBase Connection, that the connection object is
 >  duplicated ?
 >  The ZSQL method objects are duplicated also ?
 >  So: the requests' processes are separated ?

The DA authors should handle this for you such that
you do not need to worry about these details...

 > 5.)

Note: it is *much* better to send several small messages
(each with a well chosen "Subject) than a huge message with
dozens of questions.

I am going to loose patience....

 >  I wan to log in users under zope just like php.
 >  This is the logical scheme (pseudo):

Usually, Zope DA's do not support this (as connections are
often expensive and most databases only allow authentication
when the connection is opened).

 > 6.)
 >  Under Zope I how to create/set an variable in PyScript what useable
 >  in DTML ? So how to set more DTML variables under PyScript ?
 >  (example: dtml_username='xxx'; dtml_func="8"; etc.)

You can set request variables (with the request's "set" method).
But, it is not very good style.

 > 7.)
 >  If I write this:
 >   <dtml-var expr="myzsqlmethod">
 > 
 >   I get all of results of the method ?

No, you get none at all.

What you get is the Z SQL Method object itself.
The context will probably coerce it into a string and the result
looks like "<ZSQLMethod at 0xfdfdff>".
Your browser will not understand this funny tag and ignore it.

 > 8.)
 >  What is the ZSQL method caching (1000 row)?

You must read more carefully!

It says:

  *  "Maximum rows to retrieve": this limits the number of rows retrieved
     from the database (per request).

     Use "0" for unlimited

  *  "Maximum results to cache": this limits the number of query results
     (i.e. calls of the ZSQL Method) held in the cache

  *  "Maximum time (sec) to cache": this limits the time a single
     result is held in the cache.


 > 9.)
 >  How to I import XML file ?
 >  I export my zope folder in home. I want to use another site.
 >  But I cannot do import.
 >  I try with these variations:
 > 
 >    c:\test.xml
 >    file://localhost/C:/test.xml

Please read the Zope Book!  Carefully, if you already did!

For security reasons, files are only imported from Zope's "import" folder...

-- 
Dieter



More information about the Zope mailing list