there's no feature to leverage in the current code.....
After all, a "factory" is something "ethereal" where your code needs to
manage db interactions (and whatever needs to be done).
SQLFORM.factory is just a shortcut:
- to "play" with your current models
- to save you defining a table just to generate a form ('cause you can pass
Field() to it)
- have default validators available
you can't expect more "auto-magic" features out of it.... You can use
_filter_fields() to see which table belongs the input name, as long as your
input names are distinct.
On Monday, April 1, 2013 4:31:47 PM UTC+2, Lamps902 wrote:
>
> If you have something like the following:
>
> form = SQLFORM.factory(db.table1, db.table2)
>
> and table1 has an 'upload' field named 'file1', with table2 containing an
> 'upload' field named 'file2', the filenames stored in the tables will end
> up as 'no_table.file[number].[unique_file_identifier].[extension]. The
> 'no_table' part can be changed by passing the 'tablename' argument to
> factory(), but this will not help when there are multiple uploads from
> different tables. Is there a straightforward way (i.e. by passing arguments
> to factory()) to make the upload file names correspond to their respective
> tables, or would that have to be handled manually? Thanks.
--
---
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/groups/opt_out.