[Zope] How do I get the size of an item ?
Dieter Maurer
dieter@handshake.de
Fri, 12 Jan 2001 00:29:52 +0100 (CET)
Dimitris Andrakakis writes:
> ....
> What I need is, from a dtml method in /news, to get
> the size of an object (a file, say /news/files/file01.pdf)
> in /news/files.
You know Zope's integrated online help?
There you would find that files have a method "getSize"
that returns their size.
In the upcoming Zope bock (-> zope.org), you could read
that "dtml-with" can be used to access objects in "foreign"
contexts:
<dtml-with "news.files">
<dtml-var "_.getitem('file01.pdf').getSize()>
</dtml-with>
or
<dtml-var "_.getattr(news.files,'file01.pdf').getSize()">
will do.
Dieter