On Saturday, February 3, 2018 at 1:58:26 AM UTC-5, David Orme wrote: > > So at the moment, what users are seeing is a controller presenting > SQLFORM.grid of dataset records, and then in the 'view' argument to that > controller for a particular record, the file field is shown as the output > of the represent method of UploadWidget (so the word 'file' wrapped up > with the download link, which is ignorant of the subfolder). It isn't > obvious to me that there is a way to insert new_ds_id into that mechanism? >
The "upload" argument of SQLFORM.grid can be a function that takes the value and returns a URL, but you are still stuck having to figure out the URL from the filename, which will require a database lookup per row of the grid. An alternative is to not display the default file column in the grid and instead use the "links" argument to generate a custom column with custom download links (see "links" under http://web2py.com/books/default/chapter/29/07/forms-and-validators#SQLFORM-grid-signature). Another option is to create a custom column using a virtual field. Anthony -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.

