[Zope] NEWBIE: assign next free ID automatically

jensebaer jensebaer@hotmail.com
Mon, 16 Oct 2000 04:00:13 +0200


Hi,

it is not tested but may it works

<dtml-call "REQUEST.set('newid', _.string.atoi('0'))"
<dtml-in "objectValues('DTML Document')">
  <dtml-if "_.int(id) >= newid">
    <dtml-call "REQUEST.set('newid', _.int(id) + _.string.atoi('1'))">
  </dtml-if>
</dtml-in>

Your new id is: <dtml-var newid>



may you have to use _.string.atoi(id) instead _.int(id)

Viel Glück

Jens

----- Original Message -----
From: "Patrick Koetter" <p@state-of-mind.de>
To: <zope@zope.org>
Sent: Monday, October 16, 2000 2:59 AM
Subject: [Zope] NEWBIE: assign next free ID automatically


> Hi,
>
> I've been through the Guides, How-Tos and also some of the list-archives.
> Though I am not a programmer I finally decided to ask that question to all
> of you...
>
> I want to give Users the possibility to add documents in a folder
> <things_to_do> ;-).
> so far so good ... Then I want to control the IDs simply by assigning an
ID
> to their Form.
> I found a few articles generating either randomIDs or calculating IDs from
> ZopeTime().
>
> What is it that I want to do?
> I want to evaluate the highest ID (all are 'int') within the folder and
> assign the next highest.
> I'm sure this is easy to you...
>
> If there's a RTFM-document I'd be glad to read that.
>
> thanks,
>
> p@rick
>
>
> _______________________________________________
> 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 )
>
>