if someone, with hopefully better abilities than mine, can investigate the issue I think these links can be of help There is a difference between getting a value from the request or from request.form when unicode is involved (maurits.vanrees)
the text widget uses request and not request.form. So I added a piece of code to copy values from request.form to request.(Jean-Pascal Houde) http://osdir.com/ml/web.zope.plone.getpaid.devel/2008-05/msg00037.html ------ http://maurits.vanrees.org/weblog/archive/2007/11/search-forms-with-zope-formlib-and-batching While we are here, let's fix a possible unicode error. There is a difference between getting a value from the request or from request.form when unicode is involved: >>> request.form.get('SearchableText') u'\xff' >>> request.get('SearchableText') '\xc3\xbf' In the method zope.app.form.browser.textwidgets.TextWidget._getFormInput() the value is fetched from the request and not request.form. So you get a UnicodeDecodeError. We need to guard against that: def setUpWidgets(self, ignore_request=False): """From zope.formlib.form.Formbase. """ self.adapters = {} fieldnames = [x.__name__ for x in self.form_fields] data = {} for key in fieldnames: value = self.request.form.get(key) if value is not None and not value == u'': data[key] = value self.request[key] = value self.widgets = setUpWidgets( self.form_fields, self.prefix, self.context, self.request, form=self, adapters=self.adapters, ignore_request=ignore_request, data=data) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "getpaid-dev" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/getpaid-dev?hl=en -~----------~----~----~----~------~----~------~--~---
