[Zope] The QuickRef needs a link from the docs page.

Tino Wildenhain tino@wildenhain.de
Fri, 10 Sep 1999 09:05:25 +0200


kedai wrote:
> 
...
> i agree.  i skimmed the source and got a vague idea on how things work now.  but some things need further explaination/examples.  take these snippets from the ZQR:
> 
>         <dtml-call "REQUEST.set('list',[])">
>         <dtml-call "list.append(1)">
>         <dtml-var "list[0]">
> 
> i get the first statement.  it's in the ZQR.  its using REQUEST and set (which is def in BaseRequest , i think) and sets the values.
> 
> the 2nd stement i got only part of it.  it's calling the list object, but where did the append come from?  is it a method that the author had done already (as in the dtml-call "addDocument(.....)"> example, or is it standard Zope methods?
> if it's some method the author had done, i get it.

Its a method of the list-object. The list-object is build with [] (an
empty python
list object)

> can i safely say that REQUEST is the class and set is a method in REQUEST?  even though the BaeRequest.py never state explicitly that REQUES is a class (it only say BaseRequest is a class)?  or where did the REQUEST come from?

You have to tell between classes and objects. Classes are some kind of
factory for objects. Much like car-factories are building cars.
Different factories - different cars, so to speak.
So REQUEST is an object, built in the context of the document
generating and request-fullfilling process. It already holds 
some methods as also many other objects or variables.
(There are also some basic types in Python, like integer and float, but
you
can threat them as objects with no inheritance (you cant build
subclasses from them, since you cant reach the class, only the object, 
and they define no further methods, beside the ones for numeric
operations)

HTH

Tino Wildenhain