David Bernard wrote: > Kevin, > > I thing widget is a good place for every html fragment (for edition and not), > because : > * avoid copy paste (and synchronisation) if you have several place in your > web site where you require same or similar > display > * provide a simple way to share display feature across projects, and simple : > * developer A create a cool set of widgets > * developer A package widget as egg > * developer B install the egg > * create python code to initialise the widget, adapt the model (value or > input_value) > * and in the template only need to write a "widget.insert(data)" without > mess about CSS, JS and all HTML Tag and > attributes. > I would say that depends on how you see the apps. I have adopted the ajax/sorted table in MochiKit into some form of "widget" but it sits in its own js file and got included in the template. I use Kid to populate an ordinary table with specific class/mochi attribute which is parsed by the ajax table code.
I prefer to do it this way as I can work on them seperately, decoupling the HTML/js stuff from python stuff, as much as possible. It also has the advantage that the js can be cached by the browser. And one day, I might swap in things from dojo or other js only stuff.

