[Zope] How do I get the first ten characters of a string?

Peter Bengtsson peter@grenna.net
Fri, 23 Feb 2001 17:53:44 -0000


<dtml-var "_.str(datum)[:10]">


----- Original Message ----- 
From: "Lars Heber" <Lars.Heber@t-systems.de>
To: <zope@zope.org>
Sent: Friday, February 23, 2001 5:36 PM
Subject: Re: [Zope] How do I get the first ten characters of a string?


> Chris Withers schrieb:
> 
>  > Lars Heber wrote:
>  > >
>  > > <dtml-let myTest="'some really senseless blah'">
>  > > <dtml-var *first 10 characters of myTest*>
>  > > </dtml-let>
>  >
>  > <dtml-var "myTest[:10]">
>  >
>  > cheers,
>  >
>  > Chris
> 
>  I tested it out - didn't work.
> 
>  I wanted to do that with a date:
> 
>      <dtml-let datum="ZopeTime()+7">
>  <dtml-var "datum[:10]">
>     </dtml-let>
> 
>  "Date is unsliceable"... ??? What I want to get is just the date
> without the time!
> 
>  Any ideas?
> 
> Some more questions:
> 
> - I'd like to give my each instance of my ZClass a title, which is then
> shown in the folder window, just like documents for example.
> I tried to simply create a property "title" in my property sheet, but as
> 
> expected, it of course didn't refer to that property to show it in the
> overview.
> 
> - How can I get the source code of manage_main? I'd like to modify it a
> little within my ZClass.
> 
> Thanks to you all!!!
> 
>  Lars
> 
> 
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> 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 )