Re: [Zope] ZopeBook - URL to SQL

2000-11-24 Thread Dieter Maurer

Chris Gray writes:
  The Zope book discusses calling a ZSQL Method via a URL, saying that a
  request for a URL like:
  
http://localhost:8080/zsql_method/parameter/value
  
  "will return a result object", but what I get is the index_html document
  at the root, although I do get a rendered record with:
The ZPublisher works as follows:

  It traverses the ZODB guided by the components in your URL.
  It it arrives at the URL's end, it checks whether the
  reached object is callable (this is the case for all
  kinds of methods and documents). If it is, the object
  is called.
  If it is not, ZPublisher checks, whether the object
  has (or can acquire) a method "index_html"
  (this usually is the case). It then calls this method.

In your case:

  ZPublisher will reach the result object (as the Zope book
  describes). Unless you have wrapped this object
  into a custom class (aka brain, see "Advanced" tab),
  this is a "Record" object.
  A "Record" object is not callable.
  "index_html" is looked for, found in a folder above and
  rendered.

  That's what you see.

What can you do?

  Wrap you results into a custom brain that either
  defines a "__call__" (that would need to be a
  Python defined class) or an "index_html" (this
  may be a non-persistent ZClass).


Dieter

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] ZopeBook - URL to SQL

2000-11-24 Thread Chris Gray

Dieter,

Thanks, you've added a new room to my brain :)  Possibly that point should
be made in The Book since the discussion of Pluggable Brains comes at the
end of the chapter.

Cheers,
Chris


On Fri, 24 Nov 2000, Dieter Maurer wrote:

 Chris Gray writes:
   The Zope book discusses calling a ZSQL Method via a URL, saying that a
   request for a URL like:
   
 http://localhost:8080/zsql_method/parameter/value
   
   "will return a result object", but what I get is the index_html document
   at the root, although I do get a rendered record with:
 The ZPublisher works as follows:
 
   It traverses the ZODB guided by the components in your URL.
   It it arrives at the URL's end, it checks whether the
   reached object is callable (this is the case for all
   kinds of methods and documents). If it is, the object
   is called.
   If it is not, ZPublisher checks, whether the object
   has (or can acquire) a method "index_html"
   (this usually is the case). It then calls this method.
 
 In your case:
 
   ZPublisher will reach the result object (as the Zope book
   describes). Unless you have wrapped this object
   into a custom class (aka brain, see "Advanced" tab),
   this is a "Record" object.
   A "Record" object is not callable.
   "index_html" is looked for, found in a folder above and
   rendered.
 
   That's what you see.
 
 What can you do?
 
   Wrap you results into a custom brain that either
   defines a "__call__" (that would need to be a
   Python defined class) or an "index_html" (this
   may be a non-persistent ZClass).
 
 
 Dieter
 


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




[Zope] ZopeBook - URL to SQL

2000-11-23 Thread Chris Gray

The Zope book discusses calling a ZSQL Method via a URL, saying that a
request for a URL like:

  http://localhost:8080/zsql_method/parameter/value

"will return a result object", but what I get is the index_html document
at the root, although I do get a rendered record with:

  http://localhost:8080/zsql_method/parameter/value/dtml_method

Am I supposed to be getting something like I do with:

  dtml-var expr="zsql_method(parameter=value)"

and why am I not getting it?

Cheers,
Chris


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )