[Zope-CMF] guarded_getattr problem
Tres Seaver
tseaver@zope.com
29 Jul 2002 11:46:36 -0400
On Mon, 2002-07-29 at 11:24, Bryan C. Andregg wrote:
> Trying to delete an object I'm passing the id in a form (and I've varified
> that request/id is passed and is correct) and I'm using,
>
> <div tal:condition="python: request.submit == 'Yes'">
>
> <h2><span tal:replace="request/id">Id</span> Deleted</h2>
>
> <span tal:condition="python: manage_delObjects(request.id)">
> Delete
> </span>
> </div>
>
> However this produces a TALESerror complaining about guarded_getattr.
>
> Is the syntax wrong?
Here is how the 'folder_delete' skin method does that:
--------------------- snip ---------------------------
## Script (Python) "folder_delete"
##title=Delete objects from a folder
##parameters=
REQUEST=context.REQUEST
ret_url = context.absolute_url() + '/folder_contents'
if REQUEST.has_key( 'ids' ):
context.manage_delObjects( REQUEST['ids'] )
qs = '?portal_status_message=Deleted.'
else:
qs = '?portal_status_message=Please+select+one+or+more+items+first.'
return REQUEST.RESPONSE.redirect( ret_url + qs )
--------------------- snip ---------------------------
Note that manage_delObjects expects 'ids' to be a sequence of IDs,
not a single string.
Tres.
--
===============================================================
Tres Seaver tseaver@zope.com
Zope Corporation "Zope Dealers" http://www.zope.com