See http://www.web2pyslices.com/main/slices/take_slice/62 (also, look at the 
comments on that post for additional options).
 
Anthony

On Monday, September 26, 2011 1:06:14 PM UTC-4, Pepe Araya wrote:

> Hello, 
>
> I have a table where only store images related to x Article. 
>
> db_define_table('images',
>       Field('original_image', 'upload'),
>       Field('thumb_image', 'upload')
>
> Is efficient even, possible to make  'thumb_image' Field a computed Field?
> Something like:
>
>       Field('thumb_image', 'upload', *compute*= lambda r:*make_thumb*(r, 
> 85))
>
>
>  def *make_thumb*(r, thumb_size):
>
>     try:
>         from PIL import Image
>     except:
>         raise ImportError, "Requires PIL installed in your system."
>
>
>     size = (thumb_size, thumb_size)
>     ....
>
> Any help is welcome!
>
> thanks!
>

Reply via email to