Why not using SQLFORM.factory() and get the new buttons attributes that let you manage as many buttons as you want? It also let you manage buttons positions much more easilly then manipulate the generated form.
Richard On Wed, Sep 25, 2013 at 1:17 PM, Warren Block <[email protected]> wrote: > Trying to generate a small form that is all buttons: > > def month-example: > months = {'January', 'February', 'March'} > > form = FORM() > for month in months: > # this fails > form.add_button(month, URL(month)) > return dict(form=form) > > This generates 'NoneType' object has no attribute 'parent'. > > Creating links with helpers works: > > form += A( month, _href=URL(month) ) > > But the form is a dictionary, and the months are out of order. I think > that add_button preserves the order, but have not verified that. > > Does add_button only work with SQLFORM? > > How can the order of elements added to a form programmatically be > controlled? > > -- > Resources: > - http://web2py.com > - http://web2py.com/book (Documentation) > - http://github.com/web2py/**web2py <http://github.com/web2py/web2py>(Source > code) > - > https://code.google.com/p/**web2py/issues/list<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 > web2py+unsubscribe@**googlegroups.com<web2py%[email protected]> > . > For more options, visit > https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out> > . > -- 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/groups/opt_out.

