Here's the handiest hack I've come up with in quite awhile. This should go
into a "module" so it is compiled once and added to the DIV class:
from gluon.html import DIV
def extend(self,coll):
self._setnode(coll)
ret = self.components.extend(coll)
self._fixup()
return ret
DIV.extend = extend
OK, it's pretty simple. All it does is add the valuable 'extend' method to
DIV. But once added, it allows you to add whole collections of HTML
helpers to a containing HTML helper in a single call, instead of iterating
with "append".
Maybe 'extend' should be added to DIV in the official release instead of
monkey-patched...
--
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.