I think I have solved the problem.
While I dug in the library sources I found this code in
formencode/schema.py:
# are iterators (list, tuple, set, etc) allowed?
if self._value_is_iterator(value) and not
getattr(validator, 'accept_iterator', False):
errors[name] =
Invalid(self.message('singleValueExpected', state),
value_dict, state)
so I deduced that the validator FileField must have the parameter
accept_iterator=True
as in:
w.FileField(name='modello',
validator=v.FieldStorageUploadConverter(accept_iterator=True))
and now it works.
j
On 03/19/2014 03:36 PM, Jose Soares wrote:
Hi all,
I'm still migrating from tg1.1 to tg1.5 and today I found a strange
behavior using the FileField widget,
in fact in 1.5 version I can't upload files anymore.
It get me this message:
Please provide only one value
in previous version (1.1) the FileField.value was:
FieldStorage('modello', 'my.odt')
and now it is:
<cherrypy._cpreqbody.Part object at 0xd496450>
What can I do to solve this problem?
Thanks for any help.
j
--
You received this message because you are subscribed to the Google Groups
"TurboGears" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/turbogears.
For more options, visit https://groups.google.com/d/optout.