I have a problem using FileField inside RepeatingFieldSet.

class AddFellowshipFields(widgets.WidgetsList):
    files = widgets.RepeatingFieldSet(legend='Upload
files',repetitions=max_no_files, \
    fields=[widgets.FileField(label="Upload
file",attrs=dict(size="50")), \
 
widgets.TextField(label="Note",attrs=dict(size="100"),validator=validators.String())])

AddFellowshipForm =
widgets.TableForm(fields=AddFellowshipFields( ),submit_text="Add or
Update")

Upon submission of the form, the error is:

Traceback (most recent call last):
  File "c:\python24\lib\site-packages\CherryPy-2.2.1-py2.4.egg\cherrypy
\_cphttptools.py", line 103, in _run
    applyFilters('before_main')
  File "c:\python24\lib\site-packages\CherryPy-2.2.1-py2.4.egg\cherrypy
\filters\__init__.py", line 151, in applyFilters
    method()
  File "c:\python24\lib\site-packages\CherryPy-2.2.1-py2.4.egg\cherrypy
\filters\decodingfilter.py", line 31, in before_main
    self.decode(enc)
  File "c:\python24\lib\site-packages\CherryPy-2.2.1-py2.4.egg\cherrypy
\filters\decodingfilter.py", line 47, in decode
    decodedParams[key] = [v.decode(enc) for v in value]
  File "C:\Python24\lib\cgi.py", line 544, in __getattr__
    raise AttributeError, name
AttributeError: decode

I tried adding the two file validators but at no avail. If FileField
is replaced with TextField, it works. Also, if FileField is used stand
alone, i.e., without RepeatingFieldSet, it works.

Any help is greatly appreciated.


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to