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!
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.