[web2py] Re: How to not show the "delete file" checkbox

2011-06-08 Thread Luis Goncalves
Excellent! Thank you both! Before I had [file | (cbox) delete ] requires=IS_IMAGE() got rid of the delete and checkbox, but now I am still left with [file] (a link to download the file) Might have to do server-side DOM parsing to get rid of that ... Thanks!!! Luis.

[web2py] Re: How to not show the "delete file" checkbox

2011-06-07 Thread villas
As Anthony said, to avoid showing the delete checkbox just do something like this: Field('pic', 'upload', requires=IS_IMAGE()), On Jun 6, 6:31 pm, Richard Vézina wrote: > I understand your need!! > > I just don't know neither how to do it... It was the only piece of the book > I come up with af

Re: [web2py] Re: How to not show the "delete file" checkbox

2011-06-06 Thread Richard Vézina
I understand your need!! I just don't know neither how to do it... It was the only piece of the book I come up with after few reading and searching... I thought the option could make the file/delete box to desapered... Work around could to use jQuery to make the whole block to desapeare... Just

Re: [web2py] Re: How to not show the "delete file" checkbox

2011-06-06 Thread Anthony
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 che

Re: [web2py] Re: How to not show the "delete file" checkbox

2011-06-06 Thread Luis Goncalves
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

Re: [web2py] Re: How to not show the "delete file" checkbox

2011-06-06 Thread Richard Vézina
Maybe you could try autodelete : http://web2py.com/book/default/chapter/07?search=upload+#autodelete Really not sure it will work, but you could try... But if your record is deleted you file will be deleted too no matter if it is

[web2py] Re: How to not show the "delete file" checkbox

2011-06-06 Thread Luis Goncalves
Thanks for the reply! I tried that, but it didn't do what I want. I wasn't very clear in explaining what I'm trying to do (sorry about that!). I have a file upload field in my SQLFORM, and it has a "choose file" button, and right next to it a [file| (chk-box) delete] element.. I want to ge

[web2py] Re: How to not show the "delete file" checkbox

2011-06-06 Thread Ross Peoples
In your SQLFORM call, you should be able to set deletable=False http://web2py.com/book/default/chapter/07#SQLFORM