[ZDP] BackTalk to Document The Zope Book (2.6 Edition)/Using Zope Page Templates

webmaster at zope.org webmaster at zope.org
Mon Nov 10 23:00:19 EST 2003


A comment to the paragraph below was recently added via http://zope.org/Documentation/Books/ZopeBook/2_6Edition/ZPT.stx#2-59

---------------

    To start, you need to write just one line of Python.  Go to the
    'FileLib' folder and create a 'Script (Python)' in that folder.
    Give the script the id 'files' and click *Add and Edit*.  Edit the
    script to contain the following Python code::

      ## Script (Python) "files"
      ## 
      return container.objectValues(['File'])

      % Anonymous User - Nov. 4, 2003 10:52 am:
       Thanks. We are learning about TAL and three pages into it we are confronted with Python.
       Is there no way of doing this with TAL?

      % Anonymous User - Nov. 10, 2003 11:00 pm:
       No - there isn't (the short answer, but there are ways, it's just not the point). The point is to separate
       the presentation from the actual logic. If you want to do logic in your templates, take a look at DTML. If
       you are reading this to build a web application, you *will* need to know Python. It's not easy learning brand
       new stuff, especially if you are in completely unfamiliar territory: take a break, plod through the reading
       (some things will be explained in time), and if you are still confused join the mailing list and ask some
       questions. I've found the best way is to play with it yourself. I admit that takes *a lot* of time, but you
       really won't know it otherwise.



More information about the ZDP mailing list