Hi, since restructuring my zope objects to tidy up the project's root folder, I've been able to get objects working, but others not. I have put things like some zsql and python methods in a folder called 'helpers', so I can call a python method which spits out a dropdown HTML element, from any page as <dtml-var "helpers.category_dropdown()"> but I can't seem to make a <dtml-sendmail ..> tag work, however I refer to the mailhost object living in helpers. I've tried <dtml-sendmail mailhost="helpers/MailHost">, helpers.MailHost, and everything else I can think of, but it complains it still can't find it. Could anyone tell me how to refer to this mailhost object? TIA Ben Avery YouthNet UK (p.s. Zope 2.5.1, Python 2.1.3, Solaris 7)
Ben Avery wrote:
but I can't seem to make a <dtml-sendmail ..> tag work, however I refer to the mailhost object living in helpers. I've tried <dtml-sendmail mailhost="helpers/MailHost">, helpers.MailHost, and everything else I can think of, but it complains it still can't find it. Could anyone tell me how to refer to this mailhost object?
try: <dtml-with helpers> <dtm-sendmail mailhost="MailHost"> ... cheers, Chris
that works fine, thanks Chris. out of curiosity, is there no equivalent Python expression (e.g. "foo.bar", "_foo.bar" etc) I could just put in a tag, that does the same as <dtml-with foo> <dtml-sendmail mailhost="bar"> ... </dtml-with> which seems a bit like hard work, I just want DTML to handle presentation, rather than making it do anything more. Ben Chris Withers wrote:
Ben Avery wrote:
but I can't seem to make a <dtml-sendmail ..> tag work, however I refer to the mailhost object living in helpers. I've tried <dtml-sendmail mailhost="helpers/MailHost">, helpers.MailHost, and everything else I can think of, but it complains it still can't find it. Could anyone tell me how to refer to this mailhost object?
try: <dtml-with helpers> <dtm-sendmail mailhost="MailHost"> ...
cheers,
Chris
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Ben Avery wrote:
out of curiosity, is there no equivalent Python expression (e.g. "foo.bar", "_foo.bar" etc) I could just put in a tag, that does the same as <dtml-with foo> <dtml-sendmail mailhost="bar">
DTML is crufty as hell. You're assuming that the mailhost attribute of the sendmail tag can actually take a python expression. It can't.
which seems a bit like hard work, I just want DTML to handle presentation, rather than making it do anything more.
I'd switch to ZPT myself ;-) cheers, Chris
participants (2)
-
Ben Avery -
Chris Withers