overriding fieldnames for SQLFORM

22 views
Skip to first unread message

Jurgis Pralgauskis

unread,
Mar 10, 2017, 6:39:07 AM3/10/17
to web2py-users
Hi, 

How could I have different name in generated SQLFORM than field.name?

I'd like to have optional  field.formname  

Use-cases:

 - mult-table from with unique inputnames:
 could be:   field.formname='tablename__fieldname'

 - multi-record form (or multiform submision with ajax)
   some inputs serializers for ajax require notation for names like "tablename[id].fieldname"

Anthony

unread,
Mar 10, 2017, 11:39:04 AM3/10/17
to web2py-users
I think you are limited to either monkey patching FormWidget in gluon.sqlhtml or using server-side DOM manipulation on the form object after it has been created.

Anthony
Reply all
Reply to author
Forward
0 new messages