Re: [Zope] How do I get the size of an item ?

2001-01-12 Thread Dimitris Andrakakis

Daniel wrote:
> You don't need the dtml-var inside another dtml-var i.e once you are in
> dtml you are in it. try something like this
>
> 
> >
> > 

Your advice was truly enlightning ! It didn't work exactly like this,
but this one did exactly as shown (remeber path is like
"06-01-2001/file.pdf"):


   <--- this gets me into the "06-01-2001" dir
 <--- this gives me the variable space for
file.pdf
  

  


I'll write a HOW-TO for this in my page, I think it's worth it. Thanks
for your help all of your guys !

Dimitris
http://atlas.central.ntua.gr:8000


___
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] How do I get the size of an item ?

2001-01-12 Thread Dieter Maurer

Dimitris Andrakakis writes:
 >'])">
This is an FAQ (as you can imagine).

The list has a searchable archive, where you can find anwsers
to FAQ's.
I think, you will also find a compiled FAQ list via the
Zope documentation portal (zdp.zope.org).

This time, still , I will answer your question:

  if you would like to use "" inside
  a Python expression, you can simply omit it
  (just use the "...") in most cases.
  It is more safe, however, to use "_[...]" instead,
  as this gives the same result.

  In your case (I suppose "path" is a string giving the filename
  (without path component) that can access the file from the
  current context!),
  you could probably use:
  

  If "path[11:]" contains pathname component, you probably
  will need to use "restrictedTraverse" (--> Online API reference).


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 )




Re: [Zope] How do I get the size of an item ?

2001-01-12 Thread Dimitris Andrakakis

ethan mindlace fremen <[EMAIL PROTECTED]> wrote:
> 
> 
> 

Thanks ethan (& dieter too). I'm terribly sorry about requesting
a receipt (I had the option on OE forgotten), it will not happen again.

I have tried your suggestion, and indeed it works. Now, how does 
this work when the "file.pdf" is given as a DTML-VAR ?

The situation is, I retrieve the file names from MySQL, so
what I actually have is a . "Path" is
something like "06-01-2001/file.pdf". So I try this, but it
won't work (it won't parse, actually).


   '])">


I guess my question is actually about nested DTML, isn't it ?

Dimitris
http://atlas.central.ntua.gr:8000


___
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] How do I get the size of an item ?

2001-01-11 Thread Dieter Maurer

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:


  


or



will do.


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 )




Re: [Zope] How do I get the size of an item ?

2001-01-11 Thread ethan mindlace fremen

Dimitris Andrakakis wrote:
> 
> ...anyone ?
> 
> Say I have these folders:
> /
> /news
> /news/files
> 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.





should do the trick.
-- 
-mindlace-
Zopatista Community Liason

___
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] How do I get the size of an item ?

2001-01-11 Thread Dimitris Andrakakis

...anyone ?

Say I have these folders:
/
/news
/news/files
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.

Thanks in advance,
Dimitris


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