[Zope-CMF] Re: Bug with CMFUid content when copied indirectly and some confusion.

Gregoire Weber gregweb at gmx.ch
Thu Aug 26 05:07:27 EDT 2004


Hi!

At 09:42 26.08.2004 +0200, yuppie wrote:
>Hi Tim!
>
>Tim Hoffman wrote:
>>As I understand it, a call to uidtool.register(object) is in main
>>template. This gets called and if the object doesn't have a uid a new uid
>>(UniqueIdAnnotion instance) is created and stored as an attribute if the content object (currently named cmf_uid).  (UniqueIdAnnotation has
>>manage_afterAdd and manage_afterClone methods etc).  So far so good.
>
>Reading your later mails, I think this is the basic misunderstanding. The call to uidtool.register(object) in main_template is no general mechanism to assign UIDs. It's just a part of the permalinks implementation.
>
>UIDs are not assigned by default. If your application needs UIDs for folders, it has to register them.

That's it!
Sorry Tim,  I didn't factor that out enough exactly inmy e-mails.

>Writing that, I wonder why you have to use 'register' to make sure you get an UID. Wouldn't it be better if 'getUid' registers objects if necessary?

It is the easiest way to get an uid if it not yet exists.
The proper solution would be to attach uids after they have been added
and then ask for the uid with the get/query methods.

Gregoire
 



More information about the Zope-CMF mailing list