This depands on many issue GAE vs non-GAE, T2 vs non-T2, etc.

The code below does not work because default is a value and the moment
of defining the model you do not have a value.

1) let me assume non-GAE and non-T2.

you have to create the thunbnail manually after insert.

if form.accepts(....):
     filename=form.vars.image
     thumbnaum_filename=make_thumbnail(filename)
     db(db.foto.id==form.vars.id).update(thumbnail=thumbnail_filename)

2) let me assume non-GAE and T2.

     def thumb(form):
         filename=form.vars.image
         thumbnaum_filename=make_thumbnail(filename)
         db(db.foto.id==form.vars.id).update
(thumbnail=thumbnail_filename)
     form=t2.create(db.foto,onaccept=thumb)

3) If you are on gae you need a blob field.

Hope this helps.

Massimo
On Dec 8, 5:58 pm, "Wes James" <[EMAIL PROTECTED]> wrote:
> Would this work?
>
> db.define_table('foto',
>     SQLField('name'),
>     SQLField('image','upload'),
>     SQLField('thumbnail','upload',default=thumbnail(foto.image)))
>
> with a function somewhere called thumbnail to do this manipulation?
>
> thx,
>
> -wj
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to