[Zope-CMF] default values
Andreas Jung
lists at andreas-jung.com
Mon Dec 4 11:38:11 EST 2006
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
- --On 4. Dezember 2006 16:53:35 +0100 cristi <cristi at medialab.sissa.it>
wrote:
>
>>
>>> Hello all,
>>>
>>> I have a Zope+Plone web application and one of my forms aks the
>>> user for some information. Then this information is saved in the
>>> Zope database.
>>>
>>
>>
>> Huh? When you work with Plone then you are using Archetypes for
>> content-types?! Archetype fields can have a 'default' parameter. Check
>> the docs!
>>
>
> thank you, but unfortunately this is not ok for me. the documentation says
> the filed receives the value during the object initialization. So when the
> object will be shown in the HTML form it will contain the default value,
> but
> the user can invalidate it. However, I want to allow the user to save
> such an
> object but if the field is empty/null/invalid then i want to provide a
> default
> value.
>
> I hope I was clear enough. Otherwise please ask.
Write your own mutator methods that implement the desired behavior instead
of using th autogenerated mutator methods.
- -aj
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)
iD8DBQFFdE7zCJIWIbr9KYwRAm0MAKDhaN5bJ9Nj59/GmkHBKJ79xi5jhgCfXPd7
ILCghlRA+pWVPIDBqMT2QWk=
=vKMk
-----END PGP SIGNATURE-----
More information about the Zope-CMF
mailing list