I´m helping myself.
I need to add fiels=['f1','f2','f3'] excluding the field foto! in sqlform

Thank you me!
:)

2013/1/17 António Ramos <ramstei...@gmail.com>

> hello
> i have a strange behaviour in my sqlform
>
> def attach_image_to_record(form):
>
>     if form.vars.delete_this_record not in ['on']:
>
>         response=requests.get(form.vars.fp_url)
>         img=Image.open(StringIO(response.content))
>         img.save('foto1231.jpg','JPEG')
>         temp=open('foto1231.jpg','rb')
>         foto=db.trabalhador.foto.store(temp,'foto.jpg')
>         print "print new foto",foto   # this prints something like
> trabalhador.foto.123o817.asdasdaid.jpg
>         form.vars.foto=foto
>
>
> if trabalhador_form.process(onvalidation=attach_image_to_record).accepted:
>     print "trab foto",trabalhador_form.vars.foto
> # this prints something like
> trabalhador.foto.987398734982734.12312o319832789.txt
>
> in my upload folder i see the 2 files.
> The txt inside has writen the name of the image file above
>
> Why?
>
> Thank you
>
>
>

-- 



Reply via email to