[Zope3-dev] Re: Widget problems? Is there work in progress?

Garrett Smith garrett at mojave-corp.com
Sat May 29 13:45:26 EDT 2004


Roger Ineichen wrote:

> The method _toFieldValue confuse me a little bit.
> 
> My open questions are:
> 
> - The attr convert_missing_value means we 
> get the self._missing back if we set to True
> otherwise we get the unicode(value) back?

I've added a doctest for convert_missing_value, which should illustrate 
the intent of the attribute. Instead of pasting it here, you can access 
it in the test_textwidget.py unit test:

http://svn.zope.org/Zope3/trunk/src/zope/app/form/browser/tests/
test_textwidget.py?rev=25130&view=auto

The current implementation is correct, as far as can see.

> - What should we decode in the method decode_html?
> Is this for unexcepted use of the TextWidget?
> Or why should a <input type="text" value=""> tag 
> contain HTML Code? The TextAreaWidget does.
> This means also we can't store unconverted 
> HTML tags with this widget or at least '<' and '>'.

I think you're right. The use of decode_html here is wrong. If someone 
can make a case for this, we can keep it in, but I think it should be 
pulled.

I suppose, in the spirit of convert_missing_value, we could provide a 
convert_html_codes attribute to TextWidget, which would make this 
behavior configurable, but I'd be interested in what the driving use 
case is.

  -- Garrett





More information about the Zope3-dev mailing list