alfonsodg / demo-web2py

Apache License 2.0
0 stars 0 forks source link

upload.widget not showing 'delete file' checkbox #190

Closed alfonsodg closed 10 years ago

alfonsodg commented 10 years ago

From villa...@gmail.com on February 14, 2011 19:12:16

The upload.widget does not show a 'delete file' checkbox for an upload field with a 'requires' clause.

Field('pic', 'upload'), ### This shows delete checkbox... Field('pic', 'upload', requires=IS_IMAGE()), ### ...this does not

Original issue: http://code.google.com/p/web2py/issues/detail?id=192

alfonsodg commented 10 years ago

From massimo....@gmail.com on February 18, 2011 06:38:04

This is correct. If you delete it is not longer an image. Try

requires=IS_EMPTY_OR(IS_IMAGE())

Status: Invalid

alfonsodg commented 10 years ago

From villa...@gmail.com on February 18, 2011 10:09:53

You are right and that is logical. I added a small note about it in the IS_IMAGE() section of the book.