[Zope] - Document modification time

Kent Polk kent@eaenki.nde.swri.edu
Mon, 7 Dec 1998 16:30:37


Hi Amos (Amos Latteier), in <3.0.5.32.19981207142024.00adf3e0@mail.aracnet.com> on Dec 07 you wrote:
> 
> I propose that there should be something analogous to the PARENTS list for
> Documents. Maybe is should be called CALLERS or DOCUMENTS or something. It
> should be a list of Documents, so that when index_html calls
> standard_html_header which calls mydoc, mydoc should be able do something
> like:
> 
> <!--#var "CALLERS[-1].bobobase_modification_time()"--> To call a method on
> index_html (the first CALLER).
> 
> Thoughts?

Close...

What about a parent document which lists child documents? I need to be
able to query the list of child objects which are referenced in the parent
document and find the latest date. And I'd like to be able to extend that
behavior to things like like sql query results so they can contribute their
'modification date'.  And no, I don't want to discuss issues about walking
the tree right now. :^)

In the past, I have tried to examine subobjects in this manner in order to
produce an examination result and have met with varying degrees of success.
For example, I was trying to examine the objectValues of a series of Conferas:

<!--#in "objectValues('Confera Topic')" skip_unauthorized=1 sort=bobobase_modification_time -->
  <!--#in "_['sequence-item'].objectValues()" -->
     <!--#var uniqueId--> :
     <!--#var id--> :
     <!--#var meta_type--><BR>
  <!--#/in objectValues-->
<!--#/in objectValues-->

Though the documentation indicates that Conferas support objectValues, I get the
following error when examining Conferas and don't when examining Folders.
(this is with Principia):

 Error type:  AttributeError
 Error value: objectValues
 Error traceback:Traceback (innermost last):
  File ./Document.py, line 80, in __call__
    (Object: listConferas)
  File ./DT_String.py, line 471, in __call__
    (Object: listConferas)
  File ./DT_In.py, line 634, in renderwob
    (Object: objectValues('Confera Topic'))
  File ./DT_In.py, line 583, in renderwob
    (Object: _['sequence-item'].objectValues())
  File ./DT_Util.py, line 223, in eval
    (Object: _['sequence-item'].objectValues())
  File <string>, line 0, in ?
  File ./DT_Util.py, line 97, in careful_getattr
AttributeError: objectValues

</pre>

<!--
Traceback (innermost last):
  File /opt/home/htdb/Principia/lib/python/Components/cgi_module_publisher.py, line 1457, in publish_module
  File /opt/home/htdb/Principia/lib/python/Components/cgi_module_publisher.py, line 933, in publish
  File ./Document.py, line 80, in __call__
    (Object: listConferas)
  File ./DT_String.py, line 471, in __call__
    (Object: listConferas)
  File ./DT_In.py, line 634, in renderwob
    (Object: objectValues('Confera Topic'))
  File ./DT_In.py, line 583, in renderwob
    (Object: _['sequence-item'].objectValues())
  File ./DT_Util.py, line 223, in eval
    (Object: _['sequence-item'].objectValues())
  File &lt;string&gt;, line 0, in ?
  File ./DT_Util.py, line 97, in careful_getattr
AttributeError: (see above)

-->

=====================================================================
Kent