[Zope-dev] REQUEST.args

Brian Brinegar brinegar@pier.ecn.purdue.edu
Mon, 24 Feb 2003 12:54:41 -0500


Hi,

I'm using some of Casey Duncans code that I got off of zopelabs.com in a 
product that I created. The code allows you to call any object 
generically. The code is listed below this message. The problem I have 
is if my object is called from a DTML Method like <dtml-var object> the 
"args" attribute of the REQUEST object disappears and I get an attribute 
error. I can call it like this <dtmi-var "object(this(), REQUEST)"> and 
it will work.  Anyway, somewhere the REQUEST object is changing. Any ideas?

Thanks,
-Brian

import Acquisition
from ZPublisher.mapply import mapply
from ZPublisher.Publish import call_object, missing_name, dont_publish_class

class MyClass(Acquisition.Implicit,...):
   ...
   def __init__(self, some_object_id):
       self.data_source_id = some_object_id

   def index_html(self, REQUEST, RESPONSE):
        object = getattr(self.aq_parent, self.data_source_id)
        result = mapply(object, REQUEST.args, REQUEST,
                        call_object,1,
                        missing_name,
                        dont_publish_class,
                        REQUEST, bind=1)
        ...process the result...
        return result