Jonathan Bowlas
2011-06-14 16:10:14 UTC
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.
Cheers
Jon
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.
Cheers
Jon
--
Jonathan Bowlas
Web Support Officer
Media Services
University College London
Email: j.bowlas at ucl.ac.uk
Jonathan Bowlas
Web Support Officer
Media Services
University College London
Email: j.bowlas at ucl.ac.uk