It looks like the upload widget only displays the 'delete' checkbox if 
requires==[] or requires is IS_EMPTY_OR. So, if you set requires to any 
other validator, such as IS_IMAGE or IS_UPLOAD_FILENAME (or maybe a custom 
dummy validator if you don't really want/need any validation), the delete 
checkbox will not appear (the reason is that if you delete the file when 
there is another validator present, it would cause the validation to fail -- 
so the delete checkbox is only shown when there are no validators or the 
IS_EMPTY_OR validator is used).
 
Alternatively, you could use server side DOM parsing to remove the delete 
checkbox (
http://web2py.com/book/default/chapter/05#Server-side-DOM-and-Parsing), or 
write a custom upload widget.
 
Anthony
 
On Monday, June 6, 2011 12:38:19 PM UTC-4, Luis Goncalves wrote:

> Hi Richard!
>
> I'm displaying the form to the user for them to update it.  There are 
> several fields in the form, and one of them is an image ('upload' field).  
>
> I just don't want to display the  "delete file" checkbox for the image,  so 
> that the user can't delete the image.  They can upload a new one, but they 
> can't delete it to not have an image. 
>
> The record itself is not to be deleted either, but that's not even an 
> option for the user right now.
>
> Thanks!!
>
> Luis
>

Reply via email to