Re: [Zope-dev] How do I call an HTMLFile in context provided by a path

2001-04-13 Thread Tres Seaver

Itai Tavor <[EMAIL PROTECTED]> wrote:

> Dieter Maurer wrote:
> 
> >Itai Tavor writes:
> >  > P.S Now that aq_parent is working... why can't I do
> >  > absolute_url() on DTMLFiles :-(
> >"absolute_url" is provided by the class "OFS.Traverable".
> >Apparently, "DTMLFile" is not derived from it.
> >
> >
> >Dieter
> 
> Well, obviously... the question is why nobody saw the need to add 
> Traversable to DTMLFiles...

DTMLFiles are supposed to function as *methods* of their classes;
methods *don't* have their own 'absolute_url', but return the url
of the object on which they are called.  DTMLMethods have exactly
the same semantics:

  

returns the folder/context object's URL, by design.

Tres.
-- 
===
Tres Seaver[EMAIL PROTECTED]
Digital Creations "Zope Dealers"   http://www.zope.org

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



Re: [Zope-dev] How do I call an HTMLFile in context provided by a path?

2001-04-13 Thread Martijn Pieters

On Fri, Apr 13, 2001 at 11:13:38AM +1000, Itai Tavor wrote:
> Dieter Maurer wrote:
> 
> >Itai Tavor writes:
> >  > P.S Now that aq_parent is working... why can't I do absolute_url() on
> >  > DTMLFiles :-(
> >"absolute_url" is provided by the class "OFS.Traverable".
> >Apparently, "DTMLFile" is not derived from it.
> >Dieter
> 
> Well, obviously... the question is why nobody saw the need to add 
> Traversable to DTMLFiles...

Maybe we overlooked it. Make your case in a Collector issue, I'd say.

-- 
Martijn Pieters
| Software Engineer  mailto:[EMAIL PROTECTED]
| Digital Creations  http://www.digicool.com/
| Creators of Zope   http://www.zope.org/
-

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



Re: [Zope-dev] How do I call an HTMLFile in context provided by a path?

2001-04-12 Thread Dieter Maurer

Itai Tavor writes:
 > P.S Now that aq_parent is working... why can't I do absolute_url() on 
 > DTMLFiles :-(
"absolute_url" is provided by the class "OFS.Traverable".
Apparently, "DTMLFile" is not derived from it.


Dieter

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



Re: [Zope-dev] How do I call an HTMLFile in context provided by a path?

2001-04-11 Thread Dieter Maurer

Itai Tavor writes:
 > I have a method that receives a path: 
 > '/MyApp/SomeSpecialist/some_id/edit_html'  and has to call edit_html 
 > in the context of some_id. If edit_html is a DTML Method, I can do 
 > this:
 > 
 >  obj = REQUEST.traverse(path)
I would use "restrictedTraverse" instead of "REQUEST.traverse"
as it uses less magic.
 >  ...
 > 
 > But when edit_html is an HTMLFile in a Python Product, obj.aq_parent 
 > doesn't work.
Why not?

This would mean that either your product is not derived
from ExtensionClass.Base or that "HTMLFile" is not derived
from "Acquisition.Implicit".


Dieter

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



[Zope-dev] How do I call an HTMLFile in context provided by a path?

2001-04-11 Thread Itai Tavor

Hi,

I have a method that receives a path: 
'/MyApp/SomeSpecialist/some_id/edit_html'  and has to call edit_html 
in the context of some_id. If edit_html is a DTML Method, I can do 
this:

 obj = REQUEST.traverse(path)
 return obj(obj.aq_parent, REQUEST)

But when edit_html is an HTMLFile in a Python Product, obj.aq_parent 
doesn't work. And trying to get some_id using 
REQUEST.traverse('/MyApp/SomeSpecialist/some_id') returns the 
index_html method of some_id, instead of the object itself.

Any ideas how I can fix this?

TIA, Itai
-- 
--
Itai Tavor  -- "Je sautille, donc je suis."--
[EMAIL PROTECTED]--   - Kermit the Frog --
-- "What he needs now is understanding... and a confederate victory" --
-- Dr. Jacobi, Twin Peaks --


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