[Zope-dev] how to pass 'self'
Joerg Wittenberger
Joerg Wittenberger <Joerg.Wittenberger@pobox.com>
Thu, 28 Oct 1999 20:03:47 +0200 (CEST)
Hi folks,
I'm trying to create an object in a way very simillar to some working
code, but it refuses to work. Any help?
The working code read:
<!--#with "manage_clone(f99999, 'f' + REQUEST['number'], REQUEST)"-->
<dtml-call "fsmirror(_)">
<!--#call "manage_changeProperties(REQUEST)"-->
<!--#/with-->
Now I wrote a python product, which is pretty folderish, it has a
method like this:
def manage_addFeature(self, id, file='', REQUEST=None):
""" Create a Feature """
self._setObject(id, Feature(id, data=file, REQUEST=REQUEST))
return self.manage_main(self, REQUEST, update_menu=1)
and I'm trying to substitute the manage_clone from above.
Whatever I do, I can't get this working:
<dtml-with "Control_Panel.manage_addProduct.docstore.Feature.createInObjectManager('f' + REQUEST['number'], REQUEST=REQUEST)">
When I compare the definition the whole thing becomes even blured.
Both mange_clone and manage_addFeature have 'self'. The former has
two required and one key arg, the latter has one required and one key
arg. I'd expect zope to either complain when I pass manage_clone no
self (as in the working code above) or neither complain with the
none-working code. What am I missing?
Thanks a lot
/Jerry
--
You can have it done fast,
you can have it done cheap,
and you can have it done well.
--- But you can only have two of those at once.