[Zope-dev] DocumentTemplate packaging suggestion

Phillip J. Eby pje@telecommunity.com
Sat, 03 Jul 1999 07:22:35 -0500


Now that all of Zope is Open Source, might it make sense to move the tree
tag and sql* tags to the DocumentTemplate package, since they don't really
require the rest of Zope, and make useful additions to DocumentTemplate in
its own right?  It seems to me that adding them as dynamically loaded tags
would enhance the value of the DocumentTemplate package.  The sendmail tag
of course wouldn't make sense because it requires a MailHost object, but
the other tags do not require any ZInfrastructure besides DocumentTemplate.
 Right now, I have to surgically excise the .py files from the Zope
distribution and find some reasonable place in my ZPublished code to import
them, and then repeat the process whenever either Zope or DocumentTemplates
are updated.

Although it could be argued that the sql* tags shouldn't be in the "core"
package, if they're dynamically loaded it doesn't affect much.  In fact,
they're quite useful there, as I've occasionally found the need to call
regular DTML from SQL methods in order to break up big queries into smaller
chunks or to share common code between multiple queries.

While I'm on the subject of DocumentTemplates, a seperate and entirely
unrelated suggestion that would be a lot more difficult than the one above,
but might perhaps be more relevant for Zope's core audience of content
developers...  A Zope newbie I was helping the other day found the message
"KeyError" to be hopelessly confusing, when what they'd done was misspelled
a variable name.  Perhaps certain exceptions should be re-formatted by the
DTMLDoc/DTMLMethod classes so that Zope displays more meaningful messages
like "Unrecognized name: foo", instead of the weird public-traceback +
hidden error data combo.