Greetings, How can I calculate number of days of a month in DTML method ? --- Chihiro Kuraya
checkout pythons 'monthcalendar' module. wrap it into an Externalmethod. -aj --On Freitag, 3. Oktober 2003 19:24 Uhr +0900 Chihiro Kuraya <kuraya@s-cradle.com> wrote:
Greetings,
How can I calculate number of days of a month in DTML method ?
--- Chihiro Kuraya
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Thank you for answer. But such a simple calculation needs an ExternalMethod ? DTML is not so useful, isn't it. I'm a beginner of Zope, and feel that DTML is not so powerful to develop my custom application.
checkout pythons 'monthcalendar' module. wrap it into an Externalmethod.
-aj
--On Freitag, 3. Oktober 2003 19:24 Uhr +0900 Chihiro Kuraya <kuraya@s-cradle.com> wrote:
Greetings,
How can I calculate number of days of a month in DTML method ?
--- Chihiro Kuraya
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
dtml is a markup language and allows access to a restricted number of python modules. the restriction is because of security! dtml is not python and python is not dtml. -aj --On Samstag, 4. Oktober 2003 16:53 Uhr +0900 Chihiro Kuraya <kuraya@s-cradle.com> wrote:
Thank you for answer.
But such a simple calculation needs an ExternalMethod ? DTML is not so useful, isn't it.
I'm a beginner of Zope, and feel that DTML is not so powerful to develop my custom application.
checkout pythons 'monthcalendar' module. wrap it into an Externalmethod.
-aj
--On Freitag, 3. Oktober 2003 19:24 Uhr +0900 Chihiro Kuraya <kuraya@s-cradle.com> wrote:
Greetings,
How can I calculate number of days of a month in DTML method ?
--- Chihiro Kuraya
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Hi Chihiro Kuraya, Chihiro Kuraya wrote:
Thank you for answer.
But such a simple calculation needs an ExternalMethod ? DTML is not so useful, isn't it.
I'm a beginner of Zope, and feel that DTML is not so powerful to develop my custom application.
its called DTML and not DPML for one reason: its focused on templation (T) and not programming (P). So you do your logic in python. You do it the ugly way if you include your python expression in DTML code or ZPT code, you do it the better readable but a bit restricted way in a python script object, and you so it better readable and unrestricted in an external method or product. Your problem is even solveable in an DTML embedded python expression but I'm not going to show you since I'm absolutely against messing around with logic in presentation layer :-) Regards Tino
But such a simple calculation needs an ExternalMethod ?
It's the easiest way. But if you trust the python module, you can allow its import into Zope, and use it from a Python script which can be called from DTML or ZPT.
DTML is not so useful, isn't it.
It's useful for rendering web pages. It's not very useful for programming. Python, on the other hand, is very useful for programming, and dreadful for rendering web pages.
I'm a beginner of Zope, and feel that DTML is not so powerful to develop my custom application.
It's not. And it shouldn't be. DTML, in fact, may be too powerful, which leads into the trap of mixing logic and presentation. Which will invariably make a terrible mess of your code and make redesigning either the logic or the presentation a pain. One of the reasons ZPT was invented was to be better at being less useful for programming. The developers of Zope have come to believe that separation of presentation of logic and presentation is a good thing, and have been gradually making this the most obvious way to do things. Having seen the results of having fallen into that trap, I totally agree with this approach. --jcc
participants (4)
-
Andreas Jung -
Chihiro Kuraya -
J Cameron Cooper -
Tino Wildenhain