Solution: Re: [Zope] Testing for how an object is called.

kosh@aesaeion.com kosh@aesaeion.com
Wed, 23 May 2001 03:22:15 -0600 (MDT)


I know it is in bad taste to reply to my own messages but I found what I
feel is an elegant solution and figured others might need something like
this at some point.

In the REQUEST the PUBLISHED item contains a reference to the final object
that draws to the screen. The test ends up being

if self.REQUEST.PUBLISHED is self:
	Draw however you want if your object is the final object
displaying. I used this area to draw with the object wrapped with the
header and footer.
else:
	Draw however you want when the object is included via some method
like a dtml-var call.

Have fun

Designing the webpages of tomorrow http://webme-eng.com
Designing the MMORPGS of tomorrow http://worldforge.org

On Wed, 23 May 2001 kosh@aesaeion.com wrote:

> I have several kludge ways now that do the job but none I entirely like.
> How can I check for the difference between being called with <dtml-var
> foo> and being called from foo.com/foo ?
>
> This behavior is used for both internal and external behavior of the
> object.
>
> Thanks
>
> Designing the webpages of tomorrow http://webme-eng.com
> Designing the MMORPGS of tomorrow http://worldforge.org
>
>
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> 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 )
>