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
-~----------~----~----~----~------~----~------~--~---