Mailing List Archive

Re: - Document modification time
At 03:36 PM 12/7/98, Kent wrote:
>> I did this, and it doesn't update if I change the index_html document at
>> all. In fact, it actually seems to have the date/time of the update of
>> standard_html_footer, which isn't terribly useful :-)
>
>Actually, it depends... play with it a bit more and you will see even
>more interesting behavior. :^) Part of the 'problem' is that it is
>often hard to 'set' or determine what the object is that you are dealing
>with. Is it an object or is it a method? Depends... If you think this
>is interesting, just you wait. :^) :^) These sorts of issues will help
>determine how you build your site.

...

>> Am I asking the impossible? Also, it'd be nice to be able to figure out
>> the last update time on a StructuredText document that was included with
>> <!--#var blah fmt="structured-text"-->. I'd be happy with a solution
>> that could scan through all the objects included and figure out which
>> one was most recent.

I agree that this is a bit of a problem. When you have Documents calling
Documents its sometimes hard to keep things straight. Acquisition is part
of the confusion, but I don't really think its the issue here.

Basically you have an object docA calling another docB. The docB is told to
execute a method that both it and docA implement. So it calls its own
method. Really you would like to specify that it should call the method on
DocA. This is hard to do, if you just specify the method name.

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?

-Amos

P.S. This facility would make the view dtml source widget on the Zope site
work, as well :-)
Re: - Document modification time [ In reply to ]
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
Re: - Document modification time [ In reply to ]
Hi Kent, you dummy. You wrote:

> 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-->

Ummm. I forgot where I was going... Got stuck in the exit lane and
am now suffering from vapor lock, stuck here in the traffic...

What I was thinking about was implementing it like one of those computed
attribute thingies in Tabula <!--#var latest_bobobase_modification_time-->
which I could do in an external method, as I discussed before...

How would that fit in with your suggestion? (sitting here, playing with
the clutch and flipping the turn signal switch)

Kent