On Fri, Feb 3, 2012 at 11:58 AM, VP <[email protected]> wrote:
> I have the following situation.
>
> There is a field A of type upload (image).
>
> There is another field B of type compute, which depends on A.
>
> I want to be able to process the image uploaded in field A and save
> it, but before the compute in field B is executed.  In other words,
> field B will be computed after the image in field A is processed.
>
> What is the best way to do this?
>
> Thanks.

Hi,
once I did something like this but without computed fields. It could help you:

def uploadfile():
    form = SQLFORM.factory(
        Field('field1',),
        Field('uploadField', 'upload',
uploadfolder='applications/your_app/your_folder'),
        table_name='test_table',
        labels={your_labels}
    )

    if request.vars.uploadFile!=None:
        do_whatever_with_your_file(request.vars.uploadField.file)

    if form.process().accepted:
        response.flash = 'upload OK'
    elif form.errors:
        response.flash = 'form has errors'
    return dict(form=form)


Regards,
Joaco.

Reply via email to