[Zope] "Add this" and possible bug, was Re: [Zope] Add this to Wish list

Jerome Alet alet@unice.fr
Thu, 25 Jan 2001 09:02:33 +0100 (MET)


On Wed, 24 Jan 2001, Evan Simpson wrote:

> From: Jerome Alet <alet@unice.fr>
> > Please could you include a button "Download Source" to the Python Script
> > edition form ?
> 
> Already done; There's a link in the paragraph below the text area, and above
> the upload form (in CVS).

Thanks a lot !

Now please another wish:

I've done what I describe below for my own work, but I think this might be
interesting to integrate it in Zope's core:

Wouldn't it be fine if you added three buttons on the same line as

Rename Cut Copy Delete Import/Export

in the manage_main page.

These three buttons would be:

[PARENT] => which moves the selected objects up to the parent folder.

[UP] and [DOWN] => which rename objects the following way:

Let's say I've got the following folder content:

	MyFolder
	|--Object1 (Title1)
	|--Object2 (Title2)
	|--Object3 (Title3)
	|--Object4 (Title4)

Then pressing on the [UP] button having Object3 selected I'll obtain:

        MyFolder
        |--Object1 (Title1)
        |--Object2 (Title3)
        |--Object3 (Title2)
        |--Object4 (Title4)

and the same for the [DOWN] button.

This might prove to be useful if you want to keep a certain structuration
based on the objects' ids, but be able to change their order without
modifying the ids.

I hope what I ask is clear and someone else sees an utility for that.

Doing that I've found a possible bug (maybe bug isn't the appropriate
word) with the manage_renameObjects() method:

this method accepts ids and new_ids as its arguments, ids is a list of the
old ids to rename, and new_ids the new ones. If you want to exchange 2 ids
(e.g. rename Object1 to Object2 and Object2 to Object1 which both exists)
then there's an exception saying that one of the ids already exist.

So instead of one call to manage_renameObjects() to rename both objects in
one pass, you have to call it three times: one time to rename Object1 to a
temporary id, one time to rename Object2 to Object1 and one time to rename
"tempid" to Object2.

My question is: Could you do something about this "small" problem ?

bye, and thanks for all !

Jerome Alet - http://cortex.unice.fr/~jerome