Hello! I am very new to Zope, I do not know something about Python and DTML and I am german. So, at first, I have to apologize my bad english. And now my problem: I would like to show the content of a directory. Simple. That fine Zope-book says: | <ul> | <dtml-in expr="objectValues('../File')"> | <li><a href="&dtml-absolute_url;"><dtml-var title_or_id></a></li> | </dtml-in> | </ul> should do this. I created a folder, put two JPGs from my home directory into it and pasted that code into the index_html-DTML-document. It does not work. When I view this index.html-File in a Browser, the result is: | <ul> | </ul> Please note the "space" before "</ul>". My system is GNU/Linux; Debian testing. "python -v" answers: | # /usr/lib/python1.5/exceptions.pyc matches /usr/lib/python1.5/exceptions.py | import exceptions # precompiled from /usr/lib/python1.5/exceptions.pyc | # /usr/lib/python1.5/site.pyc matches /usr/lib/python1.5/site.py | import site # precompiled from /usr/lib/python1.5/site.pyc | # /usr/lib/python1.5/os.pyc matches /usr/lib/python1.5/os.py | import os # precompiled from /usr/lib/python1.5/os.pyc | import posix # builtin | # /usr/lib/python1.5/posixpath.pyc matches /usr/lib/python1.5/posixpath.py | import posixpath # precompiled from /usr/lib/python1.5/posixpath.pyc | # /usr/lib/python1.5/stat.pyc matches /usr/lib/python1.5/stat.py | import stat # precompiled from /usr/lib/python1.5/stat.pyc | # /usr/lib/python1.5/UserDict.pyc matches /usr/lib/python1.5/UserDict.py | import UserDict # precompiled from /usr/lib/python1.5/UserDict.pyc | Python 1.5.2 (#0, Apr 10 2001, 10:03:44) [GCC 2.95.3 20010219 (prerelease)] on linux2 | Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam | import readline # dynamically loaded from /usr/lib/python1.5/lib-dynload/readline.so The installed Debian version of Zope is 2.3.3-1. Something seems to be borken. How can I fix it? TIA Holger
Hi Holger, from what you tell, you used a DMTL-Document for the code you described? That's wrong, you have to use a DTML-Method... The Zope Book tells you about the difference. The biggest problem here is that the context, your dtml is called upon is wrong. A DTML-Document provides that itself, while the DTML-Method uses the folder the method is called as context, which is what you want. Regards from Muenchen Jochen Am Freitag den, 23. November 2001, um 22:08, schrieb Holger Paulsen:
Hello!
I am very new to Zope, I do not know something about Python and DTML and I am german. So, at first, I have to apologize my bad english.
And now my problem: I would like to show the content of a directory. Simple. That fine Zope-book says:
| <ul> | <dtml-in expr="objectValues('../File')"> | <li><a href="&dtml-absolute_url;"><dtml-var title_or_id></a></li> | </dtml-in> | </ul>
should do this.
I created a folder, put two JPGs from my home directory into it and pasted that code into the index_html-DTML-document.
It does not work. When I view this index.html-File in a Browser, the result is:
| <ul> | </ul>
Please note the "space" before "</ul>".
My system is GNU/Linux; Debian testing. "python -v" answers:
| # /usr/lib/python1.5/exceptions.pyc matches /usr/lib/python1.5/exceptions.py | import exceptions # precompiled from /usr/lib/python1.5/exceptions.pyc | # /usr/lib/python1.5/site.pyc matches /usr/lib/python1.5/site.py | import site # precompiled from /usr/lib/python1.5/site.pyc | # /usr/lib/python1.5/os.pyc matches /usr/lib/python1.5/os.py | import os # precompiled from /usr/lib/python1.5/os.pyc | import posix # builtin | # /usr/lib/python1.5/posixpath.pyc matches /usr/lib/python1.5/posixpath.py | import posixpath # precompiled from /usr/lib/python1.5/posixpath.pyc | # /usr/lib/python1.5/stat.pyc matches /usr/lib/python1.5/stat.py | import stat # precompiled from /usr/lib/python1.5/stat.pyc | # /usr/lib/python1.5/UserDict.pyc matches /usr/lib/python1.5/UserDict.py | import UserDict # precompiled from /usr/lib/python1.5/UserDict.pyc | Python 1.5.2 (#0, Apr 10 2001, 10:03:44) [GCC 2.95.3 20010219 (prerelease)] on linux2 | Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam | import readline # dynamically loaded from /usr/lib/python1.5/lib-dynload/readline.so
The installed Debian version of Zope is 2.3.3-1.
Something seems to be borken. How can I fix it?
TIA
Holger
_______________________________________________ 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 )
Hi Holger, from what you tell, you used a DMTL-Document for the code you described? That's wrong, you have to use a DTML-Method... The Zope Book tells you about the difference. The biggest problem here is that the context, your dtml is called upon is wrong. A DTML-Document provides that itself, while the DTML-Method uses the folder the method is called as context, which is what you want. Regards from Muenchen Jochen Am Freitag den, 23. November 2001, um 22:08, schrieb Holger Paulsen:
Hello!
I am very new to Zope, I do not know something about Python and DTML and I am german. So, at first, I have to apologize my bad english.
And now my problem: I would like to show the content of a directory. Simple. That fine Zope-book says:
| <ul> | <dtml-in expr="objectValues('../File')"> | <li><a href="&dtml-absolute_url;"><dtml-var title_or_id></a></li> | </dtml-in> | </ul>
should do this.
I created a folder, put two JPGs from my home directory into it and pasted that code into the index_html-DTML-document.
It does not work. When I view this index.html-File in a Browser, the result is:
| <ul> | </ul>
Please note the "space" before "</ul>".
My system is GNU/Linux; Debian testing. "python -v" answers:
| # /usr/lib/python1.5/exceptions.pyc matches /usr/lib/python1.5/exceptions.py | import exceptions # precompiled from /usr/lib/python1.5/exceptions.pyc | # /usr/lib/python1.5/site.pyc matches /usr/lib/python1.5/site.py | import site # precompiled from /usr/lib/python1.5/site.pyc | # /usr/lib/python1.5/os.pyc matches /usr/lib/python1.5/os.py | import os # precompiled from /usr/lib/python1.5/os.pyc | import posix # builtin | # /usr/lib/python1.5/posixpath.pyc matches /usr/lib/python1.5/posixpath.py | import posixpath # precompiled from /usr/lib/python1.5/posixpath.pyc | # /usr/lib/python1.5/stat.pyc matches /usr/lib/python1.5/stat.py | import stat # precompiled from /usr/lib/python1.5/stat.pyc | # /usr/lib/python1.5/UserDict.pyc matches /usr/lib/python1.5/UserDict.py | import UserDict # precompiled from /usr/lib/python1.5/UserDict.pyc | Python 1.5.2 (#0, Apr 10 2001, 10:03:44) [GCC 2.95.3 20010219 (prerelease)] on linux2 | Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam | import readline # dynamically loaded from /usr/lib/python1.5/lib-dynload/readline.so
The installed Debian version of Zope is 2.3.3-1.
Something seems to be borken. How can I fix it?
TIA
Holger
_______________________________________________ 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 )
Hello, could somebody please tell me, how I could obtain the current date. I would like to provide selection lists from 1 to <todays day of month> January to <todays month> 2000 to <this year> Kind regards Andreas.
See the docs for ZopeTime() or DateTime() . Andreas ----- Original Message ----- From: "Tille, Andreas" <TilleA@rki.de> Cc: "Zope user list" <zope@zope.org> Sent: Tuesday, November 27, 2001 07:11 Subject: [Zope] Getting current date
Hello,
could somebody please tell me, how I could obtain the current date.
I would like to provide selection lists from
1 to <todays day of month> January to <todays month> 2000 to <this year>
Kind regards
Andreas.
_______________________________________________ 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 )
On Tue, 27 Nov 2001, Andreas Jung wrote:
See the docs for ZopeTime() or DateTime() . Well, for sure I've seen it. Should I add that I'm such a bloody beginner that I do not understand the API Reference in the Zope Book that I need an *example* how to *really* use this functions.
I would like to provide selection lists from
1 to <todays day of month> January to <todays month> 2000 to <this year>
Thanks for your patience Andreas.
If you want to see a good example, see Tim Cook's one on ZopeLabs (http://www.zopelabs.com/). Specifically, direct your browser to: http://www.zopelabs.com/cookbook/990690237 There you will see a working example of what you are looking for. Hope that helps, Ron "Tille, Andreas" wrote:
On Tue, 27 Nov 2001, Andreas Jung wrote:
See the docs for ZopeTime() or DateTime() . Well, for sure I've seen it. Should I add that I'm such a bloody beginner that I do not understand the API Reference in the Zope Book that I need an *example* how to *really* use this functions.
I would like to provide selection lists from
1 to <todays day of month> January to <todays month> 2000 to <this year>
Thanks for your patience
Andreas.
_______________________________________________ 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 )
import DateTime now = DateTime.DateTime() ----- Original Message ----- From: "Tille, Andreas" <TilleA@rki.de> Cc: "Zope user list" <zope@zope.org> Sent: Tuesday, November 27, 2001 1:11 PM Subject: [Zope] Getting current date
Hello,
could somebody please tell me, how I could obtain the current date.
I would like to provide selection lists from
1 to <todays day of month> January to <todays month> 2000 to <this year>
Kind regards
Andreas.
_______________________________________________ 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 )
"Tille, Andreas" wrote:
Hello,
could somebody please tell me, how I could obtain the current date.
I would like to provide selection lists from
1 to <todays day of month> January to <todays month> 2000 to <this year>
I believe the following code should do the trick: 1 to <dtml-var expr="_.DateTime().day()"><br> January to <dtml-var expr="_.DateTime().Month()"><br> 2000 to <dtml-var expr="_.DateTime().year()"> You'll find this and much more valuable info in "The Zope Book" (Appendix B). kind regards, Vitor Varalonga
participants (7)
-
Andreas Jung -
Holger Paulsen -
Jochen Häberle -
Lennart Regebro -
Ronald L. Chichester -
Tille, Andreas -
Vitor Varalonga