Create a list in the REQUEST space ????
Help!, We are trying to load user roles from a table. roles needs to be a list so that the manage_users call can set the roles. The question is how does one create a list on the fly in the REQUEST Space...? The below snippet does not create the list, any thoughts??? //snippet <dtml-in getUserRoles> <dtml-call "REQUEST.set('roles:list',name)"> </dtml-in> <dtml-call "acl_users.manage_users(submit='Add', REQUEST=REQUEST)"> Thanks, DR
"Daniel G. Rusch" wrote:
Help!,
We are trying to load user roles from a table. roles needs to be a list so that the manage_users call can set the roles.
The question is how does one create a list on the fly in the REQUEST Space...? The below snippet does not create the list, any thoughts???
//snippet <dtml-in getUserRoles> <dtml-call "REQUEST.set('roles:list',name)"> </dtml-in> <dtml-call "acl_users.manage_users(submit='Add', REQUEST=REQUEST)">
Do it as you would in python: <dtml-call "REQUEST.set('roles': ['role1','role2', name])"> or in your case <dtml-call "REQUEST.set('roles': [name,])"> -- Itamar S.T. itamars@ibm.net
Thanks, your response was close enough to get me to the solution: Not quite: <dtml-call "REQUEST.set('roles': [name,])"> But this worked: <dtml-call "REQUEST.set('roles', [name])"> Thanks for pointing me to the solution, DR
you can do this with something like: <dtml-call "REQUEST.set('list', [])"> you can append elements to the list: <dtml-call "list.append(1)"> output some elements: <dtml-var "list[0]"> slices and dtml-in also work: <dtml-in "list[1:]"> <dtml-var sequence-item><br> </dtml-in> hth peter. On Wed, 24 Nov 1999, Daniel G. Rusch wrote: :Help!, : :We are trying to load user roles from a table. roles needs to be a list :so that the manage_users call can set the roles. : :The question is how does one create a list on the fly in the REQUEST :Space...? The below snippet does not create the list, any thoughts??? : ://snippet :<dtml-in getUserRoles> : <dtml-call "REQUEST.set('roles:list',name)"> :</dtml-in> :<dtml-call "acl_users.manage_users(submit='Add', REQUEST=REQUEST)"> : :Thanks, : :DR : :_______________________________________________ :Zope maillist - Zope@zope.org :http://lists.zope.org/mailman/listinfo/zope : No cross posts or HTML encoding! :(Related lists - : http://lists.zope.org/mailman/listinfo/zope-announce : http://lists.zope.org/mailman/listinfo/zope-dev ) : -- _________________________________________________ peter sabaini, mailto: sabaini@niil.at -------------------------------------------------
participants (3)
-
Daniel G. Rusch -
Itamar Shtull-Trauring -
Peter Sabaini