I've been struggling with trying to figure out how this can be achieved ...not sure if it can be.
In db1.py I have a table defined..example:
db.define_table('form1',
Field('field1', 'string'),
Field('field2', 'string'),
Field('field3', 'integer'),
Field('form1_file', 'upload', compute=form1compute))
Then within the same models file, I have the form1compute function with the parameter row being passed to it.
form1compute generates a file with the data from the form1 and uploads it.
This works fine...
The problem is that I have this form generating dynamically, so a user may have a session where 2 instances of the form fields are generated.
What is supposed to happen is these form values should be passed into the compute function, and the file that is uploaded will contain all values from that session.
Because I have the upload field included in this table definition, it is uploading a separate file for each instance of the form even though it is all from one session.
I think I need to make a separate table which references this form1 and has an upload field, but I am unsure of what to do after... Maybe make an array that gets filled with the row values in the session, and then call on a separate function after the array has been filled with all values from the single session and then have this function insert the data to the file and then somehow call on the table with the upload field???? Not sure if this way even works .. any advice will be very helpful please and thank you!