Yes, of course you're right. The actual code is generated by this
monstrosity:
@staticmethod
def make_toolbar(buttons, id, opt):
#tb = CAT()
tb = DIV(_id=id, _class=opt.w_toolbar_cls,_style="padding:0 0 0 5px;")
for title, action, href_fcn, key in buttons:
if isinstance(action, list):
menu = DIV(_class="widget-menu")
items = list()
for title2, val, active in action:
items.append(A(title2,
_href=href_fcn(val),
_class=('' if active else 'disabled'),
data={key:val}))
btn = TAG.button(" %s "%title,SPAN(_class="caret"),
data={'toggle':'dropdown'},
_class=opt.w_toolbar_btn_cls+'dropdown-toggle
button')
menu.append(btn)
menu.append(UL(*items,_class="dropdown-menu dropdown-caret
dropdown-close"))
tb.append(menu)
else:
tb.append(TAG.button(" %s "%title,_class=opt.w_toolbar_btn_cls))
return tb
Kind of ugly but it has the advantage that it does what I want. Won't win
any contest for prettiness, tho.
-- Joe
On Monday, July 30, 2018 at 12:13:42 PM UTC-7, Anthony wrote:
>
> The particular code being pickled, if it matters, looks like this:
>>>
>>> <button class="btn btn-primary dropdown-toggle button"
>>> data-toggle="dropdown">
>>> Male
>>> <span class="caret"></span></button>
>>>
>>
> Also, just to clarify, the above is not the code being pickled. The above
> is the HTML generated by executing the view -- it is just a string and
> would not invoke gluon.html.TAG_pickler. Rather, the controller action must
> be returning a dictionary containing a FORM object, which contains a
> TAG['button'] object, which is causing the pickle recursion error. When the
> TAG['button'] object is rendered, it generates the HTML shown above.
>
> Anthony
>
--
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.