Hi.
In a table I have that:
db.define_table('products',
Field('code', unique=True),
Field('description'),
Field('brand'),
Field('pdf_path'))
I want to have a sqlform.grid that gone have all links to pdf_path field.
These are absolute links like "http://www.example.com/mycatalogue.pdf"
Here is my controller:
def products_listing():
links = [lambda row: A('pdf', _href=db.products.pdf_path)]
grid = SQLFORM.grid(db.products, orderby=db.products.code,
links=links,links_in_grid=True)
return dict(grid=grid)
I have two problems, path is relative because it begin at my website
http://..../my_application/default
And the products.pdf_path field is not considered like a filed, but like a
string.
The result is: http://..../my_application/default/products.pdf_path
I've tried also to play with the URL helper but without result.
An idea ?
Thanks.
--
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/groups/opt_out.