Alberto, Sure you can! Take a look at how fieldset is implemented... however, one word of warning... Michele and I are slightly refactoring this stuff (#613 and maybe #626) so I'd rather wait a few days . Shouldn't break anything as the interface is going to be the same but maybe some new utility functions will get in. It'l be for the better I hope :)
Regards, Alberto On Mar 2, 2006, at 3:45 AM, Jorge Godoy wrote: > > > Hi! > > > I'm willing to write a new widget to abstract a common construction > that I'm > using but I'd like to know if it is considered a good practice to > have widgets > inside my template. > > For example, instead of having: > > ====================================================================== > ========== > class MyWidget(FormField): > > template = """ > <table align="left" width="100%" xmlns:py="http://purl.org/kid/ns#"> > <thead> > (... A BUNCH OF HTML CODE HERE ...) > </thead> > <tbody> > (... ANOTHER BUNCH OF HTML CODE HERE ...) > </tbody> > </table> > """ > ====================================================================== > ========== > > I would like to have something like: > > ====================================================================== > ========== > class MyWidget(FormField): > > template = """ > <table align="left" width="100%" xmlns:py="http://purl.org/kid/ns#"> > <thead> > (... A BUNCH OF HTML CODE HERE ...) > </thead> > <tbody> > (...) > ${single_selection_field1.display(data)} > (...) > ${text_field2.display(data)} > (...) > ${button1.display(data)} > (...) > ${single_selection.display(data)} > (...) > </tbody> > </table> > """ > ====================================================================== > ========== > > to make the template easier to read and to process / present data > in a more > standard way with the rest of the application. > > > TIA, > -- > Jorge Godoy <[EMAIL PROTECTED]> > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TurboGears" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/turbogears -~----------~----~----~----~------~----~------~--~---

