Re: [Zope] dtml methods and properties
Willem Broekema writes: As a DTML method is said to work with the properties of the object it is called at: DTML method "m": dtml-var bobobase_modification_time root folder of site/m displays the date/time when the last change happened to any file in the root folder root folder/m/m displays last change date/time of method m Why does the method not display it's modification time on the first occasion? Or: why does it not give the folder's modification time on the second occasion? I suggest, you read the sections about the DTML namespace in the upcoming Zope book (online on zope.org). You will learn that the namespace is a stack of bindings. When a name is looked up, the bindings on the stack are successively asked about the looked up name. The first binding that knows the name succeeds and returns the value. At a different place in the book, you learn that a DTML method (in contrast to a DTML document) does not push itself onto the DTML namespace. Thus, you look through the DTML method onto the object, the method has been called for. You will not see the DTML method's own attributes or methods. In your first example, "bobobase_modification_time" is the attribute of the object, "m" has been called for: this is "root folder of site". In second first example, "bobobase_modification_time" is the attribute of the object, "m" has been called for: this is "m" in "root folder of site". Thus, you see "m"'s "bobobase_modification_time". It is however, the first, not the second "m". Dieter ___ Zope maillist - [EMAIL PROTECTED] 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 )
[Zope] dtml methods and properties
As a DTML method is said to work with the properties of the object it is called at: DTML method "m": dtml-var bobobase_modification_time root folder of site/m displays the date/time when the last change happened to any file in the root folder root folder/m/m displays last change date/time of method m Why does the method not display it's modification time on the first occasion? Or: why does it not give the folder's modification time on the second occasion? - Willem ___ Zope maillist - [EMAIL PROTECTED] 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 )
Re: [Zope] dtml methods and properties
On Mon, 4 Dec 2000, Willem Broekema wrote: As a DTML method is said to work with the properties of the object it is called at: DTML method "m": dtml-var bobobase_modification_time root folder of site/m displays the date/time when the last change happened to any file in the root folder This _is_ the folder's bobobase_modification_time you're getting. A folder is largely a container. Aside from creating or deleting it you can only change it by changing what it contains. Changing a folder's properties or deleting a file it contains also updates it's bbb_mod_time. root folder/m/m displays last change date/time of method m By calling m/m you've bound m as the client object for the method m. dtml-var id will give you m's id, dtml-var title will give you m's title. DTML Methods are designed to give you access to the attributes of the object they are called on. Why does the method not display it's modification time on the first occasion? Or: why does it not give the folder's modification time on the second occasion? If you make m a DTML Document it will give it's own bbb_mod_time no matter how you call it. Cheers, Chris ___ Zope maillist - [EMAIL PROTECTED] 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 )