[Zope] return value treated as dtml?

Ted holden medved at fcc.net
Fri Oct 24 13:33:09 EDT 2003


On Friday 24 October 2003 12:35, Dylan Reinhardt wrote:



> Sounds workable... what is it about passing the user a correctly-formed
> link that doesn't meet your needs?

Not in all cases.  I could easily end up passing him a link to a half gigabyte 
file, and I suspect he'd not be happy...

> > I'm guessing at this point that the best shot might be to write the list
> > of hits to a file, and then return a handle to a dtml file which would
> > pick up the list of hits from the file and do the right things with them,
> > and include the user's name or id in the name of the hit file to keep
> > users separate.
>
> I'm a bit confused at this. Is this a logging solution?  A caching
> solution?  In terms of performance, it's tough to see how it could
> possibly improve on knowing a file name and a byte offset.

No caching.  All I'm trying to do is get that filename and offset to another 
external method while avoiding all the catch-22s and sticky-wickets and what 
not.

> > The question at that point would be whether an external method could
> > return the handle of a dtml method created within Zope

> Sure.  The easiest thing to do is return a string that corresponds with
> a dtml method (or anything) available in the current namespace. Ex:

> <dtml-call "REQUEST.set('some_name', ext_method(arg1, arg2))">
> <dtml-var "_[some_name]">

Sorry but I don't quite understand that.  I need to have the external method 
return something which causes a dtml page to be acted upon and shown. 

Presumably I have a dtml page called dtmlpage1 and an external method called 
externalmethod1 both registered within the folder I'm using in zope:  what 
exactly does the python function associated with externalmethod1 need to 
return to ensure that the next thing the user sees on his browser is 
dtmlpage1?

I'm assuming also that the external method cannot return both a list of file 
and offset pairs and the information to execute a dtml page, which is why I 
assume I'd need to save the list to a file and have the dtml page pick it up.


Ted



















More information about the Zope mailing list