>
>  form=SQLFORM.factory(db.trabalhador,db.t_docs,

        submit_button="Gravar",
>         
> fields=['nome','bi','ncart','ncartval','apt_medica','apt_medicaval','val_formacao','f_doc'],
>         table_name='trabalhador',
>         upload=URL('default', 'download'),
>         uploadfolder=os.path.join(request.folder,'uploads')
>         )
>

Note, uploadfolder is an argument of Field(), not of SQLFORM() or 
SQLFORM.factory().  

            for field in row:
>
>                 if field in db.trabalhador.fields:
>                     print "setting -",row[field] ," on ",field 
>                     form.vars[field]=row[field]
>

When you specify the upload argument to SQLFORM, it creates the link to the 
file in the edit form when the form is created (i.e., in 
SQLFORM.__init__()). Setting the value of form.vars[your_upload_field] 
after the form has been created will not result in that link being added to 
the form.

Anthony

-- 



Reply via email to