At 08:00 AM 9/25/00 -0500, Steve Spicklemire wrote:
>So my retrieve item gets called..... *unfortunately* it gets
>called without any namespace parameter... so my retrieveItem
>DTML method has no way to acquire a namespace so that it can
>delagate to something else! 
>So... here is what I did... I defined a method in my Python
>subclass of Specialist..
>class MarketItemManager(ZPatterns.Specialists.Specialist):
>    """A Market Item Manager"""
>    # Specify a name for the item type:
>    meta_type='MarketItemManager'
>    def retrieveItem(self, key):
>        """ get an item...."""
>        return self.__of__(self).delegateRetrieve(self, None, key=key)
>Then I made a DTML method called 'delegateRetrieve' like so:
><dtml-return "myGreatSite.ThingManager.getItem(key)">
>this way, my integrator can edit 'delegateRetrieve' to point
>to whatever Specialist he wants to... and I have a Python
>implementation of retrieveItem.
>Does this sound OK? Am I working way too hard here? 
>(I feel like I am! ;-> )

Remember in the code where I have "# XXX DTML check?"  That's because I was
anticipating your problem, but since I didn't personally need to do what
you're doing yet, I didn't implement it.  For one thing, I was waiting to
see if Zope core method binding would get fixed.  Unfortunately, I'm not
sure that Zope method binding is going to be available for anything but
PythonMethods in 2.3.  As of right now, however, you should be able to use
a PythonMethod for retrieveItem, rather than a DTML Method, and it should

In short, even now, delegateRetrieve should not be necessary.  You should
be able to implement retrieveItem using a PythonMethod or a DTML Document
rather than a DTML Method.  (I say *should* because I have not tried it

Zope-Dev maillist  -  [EMAIL PROTECTED]
**  No cross posts or HTML encoding!  **
(Related lists - )

Reply via email to