[Zope] ZSQL direct traveral question

Jeff K. Hoffman jkhoffman@usa.net
Thu, 18 Mar 1999 18:38:42 -0500 (EST)


On Thu, 18 Mar 1999, John Eikenberry wrote:

> I've been messing around with using direct traveral on the ZSQL methods.
> I'm having a problem getting the traveral to work with anything more than
> one level of depth, eg:
> 
> http://zope.kavi.com/mem/2/comp_admin/contacts/
> 
> Where 'mem' is the ZSQL query (that takes one arg), and the arg is '2'.
> But it does work in this case:
> 
> http://zope.kavi.com/comp_admin/contacts/mem/2/
> 
> Is this a restriction on the use of ZSQL direct traveral, or am I doing
> something wrong.

Without seeing your folder hierarchy, I'm not quite sure what's going on.
Frankly, my head feels like it's going to explode when I try and figure
out how your second example even worked. What are comp_admin and contacts?
Folders? Where do they fit in your folder hierarchy?

I have an event calendar, in which I use direct traversal of a ZSQL Method
to display a particular event. My hierarchy is as follows:

+ events [Folder]
  - event_details_html [DTML Method]
  - dbFindEventById [ZSQL Method]

My dbFindEventById method takes on parameter, event_id. To use direct
traversal on my dbFindEventById query, using the event_details_html file
to display the details of the event with event_id of 2 requires the
following URL:

  http://localhost/events/dbFindEventById/event_id/2/event_details_html

At first, I tried:

  http://localhost/events/dbFindEventById/2/event_details_html

which looks very close to your first example, and it did not work. Then I
realized you are required to specify the name of the parameter in the URL
as well, so I added event_id before the 2, and I was off to the races.

I'm sure I've misunderstood your problem somewhere, and if I did, I
apologize for spouting off nonsense. But, I figured this just might help,
since I got tripped up when I first tried to use direct traversal, also.
Better safe than sorry. :^)

> John Eikenberry

jkh