Hello,
I'm using a TW2 form (in Turbogeras 2.1.5) including a FileFied for upload.
The FileField is declared like this:
illus_file_path = tw2f.FileField(label=_("Choose"),
validator=tw2f.FileValidator(required=True))
The validation process always fails. I investiguated and what I found
being really strange is the following code:
def to_python(self, value):
if self.required and (value is None or not value):
raise ValidationError('required', self)
if isinstance(value, basestring) and self.strip:
value = value.strip()
return value
With debug printing, I get the following information:
value = FieldStorage('illus_file_path', u'2011-10-08 18.13.38.jpg')
And not value (which is actually not FieldStorage(...)) return True !!!
>>> import cgi
>>> a = cgi.FieldStorage()
>>> not a
True
Anybody could help / explain me what is wrong?
Damien
--
You received this message because you are subscribed to the Google Groups
"TurboGears" 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/turbogears?hl=en.