[Zope] modifying objectValues from an external method?

Bowyer, Alex BowyerA@logica.com
Thu, 16 Nov 2000 16:53:45 +1100


You may remember I have posted a couple of times about problems I have had
with manage_delObjects to delete a news article object from a news page
which contains several child news article objects.

I thought I would try and avoid the problem and make a Python method to
remove the item. This method takes the list of articles (i.e. objectValues)
and does the deletion on the parameter passed in.

The problem I have is, objectValues doesn't seem to exist at Python level,
only at DTML level. So instead of:

<dtml-call "my_delete_function(objectValues)">

which is not valid, I have to use:

<dtml-let my_list=objectValues>
  <dtml-call "my_delete_function(my_list)">
</dtml-let>

The problem with this is that even though the parameter is passed by
reference, the changes are only being done to my_list and not passed back to
objectValues. So I lose them once my_list is out of scope.

Can anyone suggest an alternative or a workaround? I thought about returning
the modified list from the function, but DTML provides no functionality to
set objectValues equal to this result.

Any help would be appreciated!

Thanks

Alex

==================================
Alex Bowyer
IT Contractor, Logica Australasia
Tel    : +61 2 9202 8130
Fax    : +61 2 9922 7466
E-mail : bowyera@logica.com
WWW    : http://www.logica.com.au/
==================================