<dtml-var date fmt=Date> does not work!
Hi, trying the example <dtml-var date fmt=Date> from the DTML-Documentation, page 3, leads to the following result when viewing the page. Why? I am using Zope 2.2.4. I get the same results on W98/WNT and Linux. Without this tag, the page works. Regards Thomas {PRIVATE}{PRIVATE "TYPE=PICT;ALT=Zope"} Zope Error Zope has encountered an error while publishing this resource. Error Type: KeyError Error Value: date Troubleshooting Suggestions Thisresource may be trying to reference a nonexistent object or variable date. The URL may be incorrect. The parameters passed to this resource may be incorrect. A resource that this resource relies on may be encountering an error. For more detailed information about the error, please refer to the HTML source for this page. If the error persists please contact the site maintainer. Thank you for your patience. {HYPERLINK "http://www.zope.org/Credits"}{PRIVATE "TYPE=PICT;ALT=Powered by Zope"}{HYPERLINK "http://www.zope.org/Credits"} Traceback (innermost last): File D:\Programme\Zope\lib\python\ZPublisher\Publish.py , line 222, in publish_module File D:\Programme\Zope\lib\python\ZPublisher\Publish.py , line 187, in publish File D:\Programme\Zope\lib\python\Zope\__init__.py, line 221, in zpublisher_exception_hook (Object: ApplicationDefaultPermissions) File D:\Programme\Zope\lib\python\ZPublisher\Publish.py , line 171, in publish File D:\Programme\Zope\lib\python\ZPublisher\mapply.py, line 160, in mapply (Object: test) File D:\Programme\Zope\lib\python\ZPublisher\Publish.py , line 112, in call_object (Object: test) File D:\Programme\Zope\lib\python\OFS\DTMLDocument.py, line 177, in __call__ (Object: test) File D:\Programme\Zope\lib\python\DocumentTemplate\DT_S tring.py, line 528, in __call__ (Object: test) File D:\Programme\Zope\lib\python\DocumentTemplate\DT_V ar.py, line 276, in render (Object: date) KeyError: (see above) Thomas Volkmar Worm Diagonalstr. 25 D-20537 Hamburg Tel.: +49 40 2198 2741 Fax.: +49 40 2198 2742
this is what I use to get the current time. <dtml-var "_.DateTime()" fmt=Date> Mohan. -----Original Message----- From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Thomas Volkmar Worm Sent: Friday, December 08, 2000 4:42 AM To: zope@zope.org Subject: [Zope] <dtml-var date fmt=Date> does not work! Hi, trying the example <dtml-var date fmt=Date> from the DTML-Documentation, page 3, leads to the following result when viewing the page. Why? I am using Zope 2.2.4. I get the same results on W98/WNT and Linux. Without this tag, the page works. Regards Thomas {PRIVATE}{PRIVATE "TYPE=PICT;ALT=Zope"} Zope Error Zope has encountered an error while publishing this resource. Error Type: KeyError Error Value: date Troubleshooting Suggestions Thisresource may be trying to reference a nonexistent object or variable date. The URL may be incorrect. The parameters passed to this resource may be incorrect. A resource that this resource relies on may be encountering an error. For more detailed information about the error, please refer to the HTML source for this page. If the error persists please contact the site maintainer. Thank you for your patience. {HYPERLINK "http://www.zope.org/Credits"}{PRIVATE "TYPE=PICT;ALT=Powered by Zope"}{HYPERLINK "http://www.zope.org/Credits"} Traceback (innermost last): File D:\Programme\Zope\lib\python\ZPublisher\Publish.py , line 222, in publish_module File D:\Programme\Zope\lib\python\ZPublisher\Publish.py , line 187, in publish File D:\Programme\Zope\lib\python\Zope\__init__.py, line 221, in zpublisher_exception_hook (Object: ApplicationDefaultPermissions) File D:\Programme\Zope\lib\python\ZPublisher\Publish.py , line 171, in publish File D:\Programme\Zope\lib\python\ZPublisher\mapply.py, line 160, in mapply (Object: test) File D:\Programme\Zope\lib\python\ZPublisher\Publish.py , line 112, in call_object (Object: test) File D:\Programme\Zope\lib\python\OFS\DTMLDocument.py, line 177, in __call__ (Object: test) File D:\Programme\Zope\lib\python\DocumentTemplate\DT_S tring.py, line 528, in __call__ (Object: test) File D:\Programme\Zope\lib\python\DocumentTemplate\DT_V ar.py, line 276, in render (Object: date) KeyError: (see above) Thomas Volkmar Worm Diagonalstr. 25 D-20537 Hamburg Tel.: +49 40 2198 2741 Fax.: +49 40 2198 2742 _______________________________________________ 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 )
Why doesn't the following code work? How do I achieve the desired functionality? <dtml-let the_current_user="<dtml-var "AUTHENTICATED_USER.getUserName()">"> <dtml-var the_current_user> </dtml-let> Mohan.
Mohan try this, <dtml-let the_current_user="REQUEST.AUTHENTICATED_USER.getUserName()"> <dtml-var the_current_user> </dtml-let> -AndyD
-----Original Message----- From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Mohan Baro Sent: 08 December 2000 14:41 To: zope@zope.org Subject: [Zope] DTML-LET problems
Why doesn't the following code work? How do I achieve the desired functionality?
<dtml-let the_current_user="<dtml-var "AUTHENTICATED_USER.getUserName()">"> <dtml-var the_current_user> </dtml-let>
Mohan.
_______________________________________________ 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 )
Mohan Baro wrote:
Why doesn't the following code work? How do I achieve the desired functionality?
<dtml-let the_current_user="<dtml-var "AUTHENTICATED_USER.getUserName()">"> <dtml-var the_current_user> </dtml-let>
Mohan.
You can't embed dtml within dtml. Try: <dtml-let the_current_user="AUTHENTICATED_USER.getUserName()"> <dtml-var the_current_user> </dtml-let> Ivan PS, I would have replied to your previous post if it hadn't been in HTML!
Thanks Ivan & Peter, It work!. Mohan. -----Original Message----- From: icornell@gate.fs-cfc.co.uk [mailto:icornell@gate.fs-cfc.co.uk]On Behalf Of Ivan Cornell Sent: Friday, December 08, 2000 10:25 AM To: Mohan Baro Cc: zope@zope.org Subject: Re: [Zope] DTML-LET problems Mohan Baro wrote:
Why doesn't the following code work? How do I achieve the desired functionality?
<dtml-let the_current_user="<dtml-var "AUTHENTICATED_USER.getUserName()">"> <dtml-var the_current_user> </dtml-let>
Mohan.
You can't embed dtml within dtml. Try: <dtml-let the_current_user="AUTHENTICATED_USER.getUserName()"> <dtml-var the_current_user> </dtml-let> Ivan PS, I would have replied to your previous post if it hadn't been in HTML! _______________________________________________ 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 )
participants (4)
-
Andy Dawkins -
Ivan Cornell -
Mohan Baro -
Thomas Volkmar Worm