Re: zope.schema - overriding field with no value

Sylvain Viollon <[email protected]> Tue, 14 Jun 2011 18:28:26 +0200
Newsgroups gmane.comp.web.zope.silva.devel
Organization Infrae
Message-ID <[email protected]>
On Tue, 14 Jun 2011 17:10:14 +0100
Jonathan Bowlas <j.bowlas-hclig2XLE9Zaa/[email protected]> wrote:

  Hello,

> When creating a silva extension how would I go about overriding a non
> required field with no value.
> 
> For example I have a TextLine field:
> 
>     analytics_tracker_code = schema.TextLine(
>         title=u"Google Analytics Tracker Code",
>         description=u"Google Analytics Tracker Code ID (e.g
> 'UA-XXXXXX-X').", required=False)
> 
> However if I add a value to this field using the edit form of my
> extension and then later decide I want to remove the value by deleting
> it via the form. The existing entry is retained as there is nothing to
> overwrite it.
> 
> What can I do to get the field back to None? I tried setting
> default=None, but that doesn't work.
> 

  Yes, it is a bug I know and that people already reported to me.

  I will have a look tomorrow.

  Regards,

  Sylvain,


-- 
Sylvain Viollon -- Infrae
t +31 10 243 7051 -- http://infrae.com
Hoevestraat 10 3033GC Rotterdam -- The Netherlands