Nope. This would be correct
db.Person.photoFile.requires=(IS_EMPTY_OR(IS_IMAGE(extensions=('gif','jpg','jpeg','png'),maxsize=(100,120))),IS_LENGTH(16*1024,error_message='file size exceeds 16 KB')) but in I just noticed there is a problem in IS_LENGTH when combining it with other validators. I just fixed it in trunk, I think. Let me know if this works. Massimo On Saturday, 28 July 2012 01:02:02 UTC-5, Annet wrote: > > > I cannot reproduce the problem and I do not understand how it is possible >> that #2 is executed (with an error) but #1 is not (code below). I believe >> this is happening to you but I need your help figuring out why. >> > > I restarted my Mac, unzipped a second version of web2py and isolated the > problem. > > Apparently the validator: > > db.Person.photoFile.requires=IS_EMPTY_OR(IS_IMAGE(extensions=('gif','jpg','jpeg','png'),maxsize=(100,120)),IS_LENGTH(16*1024,error_message='file > > size exceeds 16 KB')) > > on: > > Field('photoFile',type='upload',autodelete=True) > > is the cause of the error. The print f statement in the code at line 1193 > outputs this to the console: > > <gluon.validators.IS_LENGTH object at 0x159c9dd0> > > I had a look at the parentheses in the validator, but I believe got them > right, don't I? I hope this post is more helpful than the previous posts. > > > Annet. > --