Re: [Zope] new user, teething problems
At Thursday 3/8/2006 20:14, John P. Looney wrote:
Hey, I've made my first page, though it's not working as I'd like. This is the contents of the page:
<html> <title> testing</title> Going ! <b>asdasda </b> <br> <dtml-var date fmt=Date><br> </html>
Page Templates are easier to use instead of DTML.
File "/tmp/Zope-3.2.1/build/lib.linux-i686-2.4/zope/documenttemplate/dt_var.py", line 207, in render raise KeyError(name) KeyError: u'date'
Any idea what I could be doing wrong ? No dtml tag I use seems to work - all throw an error.
This error says that there is nothing known as "date". Have you defined it anywhere? If you just want to show the current date, try: <dtml-var expr="DateTime()"> Gabriel Genellina Softlab SRL __________________________________________________ Pregunt�. Respond�. Descubr�. Todo lo que quer�as saber, y lo que ni imaginabas, est� en Yahoo! Respuestas (Beta). �Probalo ya! http://www.yahoo.com.ar/respuestas
On 8/4/06, Gabriel Genellina <gagsl-zope@yahoo.com.ar> wrote:
Page Templates are easier to use instead of DTML.
True, but this is just starting off, to make sure it works.
File
"/tmp/Zope-3.2.1/build/lib.linux-i686-2.4 /zope/documenttemplate/dt_var.py", line 207, in render raise KeyError(name) KeyError: u'date'
Any idea what I could be doing wrong ? No dtml tag I use seems to work - all throw an error.
This error says that there is nothing known as "date".
"date" was just a DHTML page that had a static string saying 'this would be a date'. Have you defined it anywhere?
If you just want to show the current date, try:
<dtml-var expr="DateTime()">
Yep, even that doesn't work (see below). Oddly, when I created a page with pure HTML as index_html at the very top level, it didn't get seen as an index page. I just get a management view when I go to the top level port. Traceback (most recent call last): File "/tmp/Zope-3.2.1/build/lib.linux-i686-2.4/zope/publisher/publish.py", line 138, in publish result = publication.callObject(request, object) File "/tmp/Zope-3.2.1/build/lib.linux-i686-2.4/zope/app/publication/zopepublication.py", line 161, in callObject return mapply(ob, request.getPositionalArguments(), request) File "/tmp/Zope-3.2.1/build/lib.linux-i686-2.4/zope/publisher/publish.py", line 113, in mapply return debug_call(object, args) File "/tmp/Zope-3.2.1/build/lib.linux-i686-2.4/zope/publisher/publish.py", line 119, in debug_call return object(*args) File "/tmp/Zope-3.2.1/build/lib.linux-i686-2.4/zope/app/dtmlpage/browser.py", line 26, in index return template.render(REQUEST, **kw) File "/tmp/Zope-3.2.1/build/lib.linux-i686-2.4/zope/app/dtmlpage/dtmlpage.py", line 49, in render return self.template(self.__parent__, request, REQUEST=request, **kw) File "/tmp/Zope-3.2.1/build/lib.linux-i686-2.4/zope/documenttemplate/untrusted/untrusted.py", line 66, in __call__ ProxyFactory(mapping), File "/tmp/Zope-3.2.1/build/lib.linux-i686-2.4/zope/documenttemplate/dt_string.py", line 484, in __call__ result = render_blocks(self._v_blocks, md) File "/tmp/Zope-3.2.1/build/lib.linux-i686-2.4/zope/documenttemplate/pdocumenttemplate.py", line 282, in render_blocks section = section(md) File "/tmp/Zope-3.2.1/build/lib.linux-i686-2.4/zope/documenttemplate/dt_util.py", line 86, in eval d) File "UntrustedHTML", line 1, in <expression> NameError: name 'DateTime' is not defined
participants (2)
-
Gabriel Genellina -
John P. Looney