[Zope] Acquisition from a DTML method in a subdirectory

Jim Anderson ezjab at ieee.org
Mon Mar 8 09:25:37 EST 2004


Troy,

Thank you for the reply. This fixed my problem. It would be interesting
to get an explanation on the arguements and why they work.

Jim


Troy Farrell wrote:

> Try changing Adtml_doc to
>
>   <dtml-var expr="B.Bdtml_method(_.None,_)">
>
> If that solves the problem, a zopista greater than I can explain why.  
> If not, all I can say is that I don't use DTML any more :(
>
> Troy
>
> Jim Anderson wrote:
>
>>
>> I'm running Zope 2.7.0 on a windows platform and
>> I have a DTML method referenced in a subdirtory
>> from a DTML document object. I want to run
>> and external method from the DTML method, but
>> Zpublisher is giving me an error message that
>> the external method resource is causing
>> a name error and the external method is not
>> defined.
>>
>> My ZMI structure looks like this:
>>
>>  root
>>    |
>>    A
>>      |
>>      Adtml_doc
>>      Aext_method
>>      B
>>        |
>>        Bdtml_method
>>
>> Adtml_doc has the following code:
>>
>>    <dtml-var expr="B.Bdtml_method()">
>>
>> Bdtml_method has code that calls Aext_method
>> in A:
>>
>>    Hi!
>>    <dtml-var expr="Aext_method()">
>>    Bye!
>>
>>
>> If I run the 'view' tab for Bdtml_method, the method
>> runs as expected and if I assume that the method returns
>> 'Good', my output is:
>>
>>    Hi!
>>    Good
>>    Bye!
>>
>> If I run Adtml_doc, I then get the error
>> message that Aext_method
>> is not defined. If I place a copy of Aext_method
>> in the B, and run Adtml_doc, I still
>> get an error message.
>>
>> I was expecting that the Bdtml_method would find
>> Aext_method by aquiring it from the A, but
>> this does not seem to be the case.
>>
>> So it seems that calling a dtml method in a subdirectory
>> does not acquire from the subdirectory or the current
>> directory? Can anyone explain this?
>>
>> More importantly what is the proper way to call
>> an external method from a dtml method being
>> referenced in a subdirectory?
>>
>>
>> Jim Anderson
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> _______________________________________________
>> Zope maillist  -  Zope at zope.org
>> http://mail.zope.org/mailman/listinfo/zope
>> **   No cross posts or HTML encoding!  **
>> (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce
>> http://mail.zope.org/mailman/listinfo/zope-dev )
>
>
>






More information about the Zope mailing list