I think this was fixed in trunk a couple of weeks ago.

Massimo

On Apr 2, 3:35 pm, Chris <crflei...@gmail.com> wrote:
> I can't seem to get a custom validator to be called on a Field of type
> 'upload' when editing a record in appadmin. It works on the other text
> fields or when inserting a new record.
>
> The validator doesn't do anything yet, but here's the what I was
> starting with to make sure it worked:
>
> class IS_FILE_TYPE(Validator):
>
>     def __call__(self, value):
>         return (value, 'message')
>
> This is using python 2.6 on linux.
>
> Using python 2.5 on OS X I get an error when editing a record and
> using the validator I wrote. Here's the traceback:
>
> Traceback (most recent call last):
>   File "/Users/chris/workspace/project/gluon/restricted.py", line 173,
> in restricted
>     exec ccode in environment
>   File "/Users/chris/workspace/project/applications/init/controllers/
> appadmin.py", line 410, in <module>
>   File "/Users/chris/workspace/project/gluon/globals.py", line 96, in
> <lambda>
>     self._caller = lambda f: f()
>   File "/Users/chris/workspace/project/applications/init/controllers/
> appadmin.py", line 275, in update
>     if form.accepts(request.vars, session):
>   File "/Users/chris/workspace/project/gluon/sqlhtml.py", line 844, in
> accepts
>     if not request_vars.get(key, None) \
>   File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/
> python2.5/cgi.py", line 624, in __len__
>     return len(self.keys())
>   File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/
> python2.5/cgi.py", line 600, in keys
>     raise TypeError, "not indexable"
> TypeError: not indexable

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.

Reply via email to