Re: {Disarmed} Re: {Disarmed} [web2py] Showing images or thumbnails in grid view

2017-12-27 Thread jcrowe
Thanks so much. That was very helpful! 
I am including the code below for anyone else trying to show images in the 
grid view.

db.define_table('photos',
Field('photo', 'upload'),
Field('username', db.auth_user, default=auth.user_id))

db.photos.photo.requires = requires = IS_IMAGE(extensions=('jpeg', 'png', 
'gif'))
db.photos.photo.represent = lambda value, row: IMG(_src=URL('download', 
args=value), _height='150')


Thanks again,
Jason

On Wednesday, December 27, 2017 at 10:29:41 AM UTC-6, Carlos Cesar 
Caballero wrote:
>
> Hi Jason, take a look at the represent param in the field constructor 
> http://www.web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Field-constructor
>
> Greetings.
>
> El 27/12/17 a las 11:13, jcrowe escribió:
>
> I am using grids as a photo manager of sorts. I am looking for a way to 
> show the image inline in the grid, rather than needing to click the view 
> button to see the images. I have searched around but I didn't find 
> anything. I figure it's either very simple and I'm the only one that 
> doesn't know how to do it or I am not using the right terminology. :D 
>
> Thanks,
> Jason
> -- 
> 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 web2py+un...@googlegroups.com .
> For more options, visit *MailScanner ha detectado un intento de fraude en 
> la siguiente página web "groups.google.com". No confíe en esta página web:* 
> *MailScanner 
> ha detectado un intento de fraude en la siguiente p�gina web 
> "groups.google.com". No conf�e en esta p�gina web:* 
> https://groups.google.com/d/optout .
>
>
>

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


{Disarmed} Re: {Disarmed} [web2py] Showing images or thumbnails in grid view

2017-12-27 Thread Carlos Cesar Caballero Díaz
Hi Jason, take a look at the represent param in the field constructor 
http://www.web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Field-constructor


Greetings.


El 27/12/17 a las 11:13, jcrowe escribió:
I am using grids as a photo manager of sorts. I am looking for a way 
to show the image inline in the grid, rather than needing to click the 
view button to see the images. I have searched around but I didn't 
find anything. I figure it's either very simple and I'm the only one 
that doesn't know how to do it or I am not using the right 
terminology. :D


Thanks,
Jason
--
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 web2py+unsubscr...@googlegroups.com 
.
For more options, visit *MailScanner ha detectado un intento de fraude 
en la siguiente p�gina web "groups.google.com". /No/ conf�e en esta 
p�gina web:* https://groups.google.com/d/optout 
.


--
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.