[Zope3-Users] z3c.form - how to set single default values from another object?

Marius Gedminas mgedmin at b4net.lt
Wed Feb 20 11:59:58 EST 2008


On Wed, Feb 20, 2008 at 01:10:57PM +0100, Hermann Himmelbauer wrote:
> Hi, I have here an add form which is based on an interface like this:
> 
> class IMyObj(Interface):
>   value1 = TextLine()
>   value2 = TextLine()
>   
> In my add form, I need to display a default value for "value2". This default 
> value is stored in another object, however, no default value should be given 
> for value1.
> 
> I'm desperatingly trying to implement this via z3c.form through various ways, 
> but none seems to work.

I am not familiar with z3c.form (being stuck with maintaining a project
based on Zope 3.2 means you don't get to play with new toys).

With zope.formlib you could solve this by passing an initial data dict
to the setUpWidgets call.  Doesn't z3c.form have something like that?

You mentioned that you looked at the source where the widgets were
updated.  I suggest you look at the place where the widgets are created
& initialized.

Marius Gedminas
-- 
"Nothing ever goes missing that they don't look at me, ever since that
time I lost my horse. As if that could be helped. He was white and it
was snowing, what did they expect?"
                -- Dolorous Edd in "A Storm of Swords" by George R. R. Martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mail.zope.org/pipermail/zope3-users/attachments/20080220/0e78d9f3/attachment.bin


More information about the Zope3-users mailing list