Am 18.03.2006 um 09:40 schrieb Alec Thomas:
I know this might be heresy, but what about using FormEncode?
While discussing the workflow ticket validation, Chris suggested
that it
would be good to have form validation across all Trac forms. This of
course would be a much bigger job than just what I had planned, but
using FormEncode would pretty much solve that problem. It would also
fulfill the requirements of this thread:
1> from formencode.htmlgen import html
2> html.table(
html.tr(
html.td()("FOO")
),
html.tr(
html.td()("BAH")
)
)
<2 <table><tr><td>FOO</td></tr><tr><td>BAH</td></tr></table>
The syntax is quite clean I think, and similar to Chris' library.
It also has a few other features which could be quite useful.
I know it introduces dependencies, but it's got some pretty useful
features, and reinventing the wheel, while it can be fun, isn't
necessarily the best route in all situations. And last but not
least, it
can't be any harder to install than ClearSilver currently is :)
Jonas and I have discussed using FormEncode in Trac some time ago,
and while in general it's a pretty nice lib, I see a few problems
with adopting it at this point:
* Additional dependencies: FormEncode itself *and* ElementTree (at
least for some parts, including htmlgen)
* The scope of FormEncode isn't clear (e.g., does htmlgen really
belong in there? do widgets?) This is important because FormEncode is
pretty young and we can't expect it to be a stable dependency for the
time being.
* Development activity on FormEncode is very low (the mailing list
hasn't seen a non-spam message since january) -- this *may* mean that
FormEncode is stable and has no problems, but it may also mean that
it's not being used heavily enough to discover/report the issues.
If/when we move to Kid (or some other template engine based on
ElementTree), we should probably reconsider using FormEncode. Until
then, I'd rather see us "reinventing the wheel" a bit here.
Cheers,
Chris
--
Christopher Lenz
cmlenz at gmx.de
http://www.cmlenz.net/
_______________________________________________
Trac-dev mailing list
[email protected]
http://lists.edgewall.com/mailman/listinfo/trac-dev