[Zope] zope and forms

Oliver Bleutgen myzope@gmx.net
Mon, 14 Oct 2002 14:47:34 +0200


Alexis Roda wrote:
> Hi all,
> I have a couple of questions:
> 
> A form contains a <input name="foo:int">. If I leave the input empty,
> when I submit the form zope complains about "integer value expected".
> Ok, the empty string is not a valid integer value, but sometimes it is
> right to leave an input field blank. Is there a way to take ride of this
> or should I use string values and check the received values in then
> method/script?
> 
> Is it possible to make zope accept dates entered into <input
> name="foo:date"> formated acording to DD/MM/YYYY?
> 

See http://www.zope.org/Members/Zen/howto/FormVariableTypes

> How can I create a new role from a python script?

Hmm, interesting, this method is private.... (_addRole)

Maybe something like

f = folder.where.to.add.the.role
RoleName = 'my_new_rolename'
f.manage_defined_roles(submit='Add Role',REQUEST={'roles',RoleName})

HTH,
oliver