Never mind the help notice. restructured the models to abundantly use
(and possibly overuse) the "audit trail" model. The results are SWEET!
any new request form that I would need to add, requires just a small
table with its unique Fields. the rest of the data is provided by
combining a few of these:

'imei=db.Table(None,'imei',
           Field('manufacturer'),
           ....'


Then this to create a new request form: one New table + one new Field
= 3 page form (most of which is pre-populate by the controller :))

db.define_table('imeiRequest',
                 common,
                 imei,
                 rm_request,
                 Field('require_cert','boolean'))


the scripted parts in the controllers take care of all work.

Thanks,
Mart :)

On Jan 10, 11:22 am, mart <[email protected]> wrote:
> Hi,
>
> I could be looking in the wring place, but i don't see an example on
> referencing ALL the fields of another table without having to name
> them - I would like the combination of tables to be  more dynamic, so
> that "sub-tables (forms) could be created on the fly depending on user
> input... something like this (taken from the 'Tip of the day' thread):
>
> def newBuildRequest():    # formerly register()
>     form=SQLFORM.factory(db.rm_request,db.buildRequest)
>     if form.accepts(request.vars):
>         id =
> db.rm_request.insert(**db.rm_request._filter_fields(form.vars))
>         form.vars.rm_request=id
>         id = db.insert(**db.buildRequest._filter_fields(form.vars))
>         response.flash='Thanks for filling the form'
>     return dict(form=form)
>
> db.define_table('rm_request',     # main form - mandatory to al forms
>         Field('fied1'),
>         Field('fied2'),
>         Field('fied3'))
>
> db.define_table('customBuildRequest',      # sub-table/form - data
> comes from custom request (request not available in list)
>         Field('fied1'),
>         Field('fied2', requires=db(db, table1.ALLFIELDS))
>
> or
>
>         Field('fied2', requires=db(db, table1.fields()))
>
> or something...
>
> Thanks,
> Mart :)

Reply via email to