[Zope3-Users] Modified IntId utility

Stefan H. Holek stefan at epy.co.at
Tue Sep 25 02:52:20 EDT 2007


On 24. Sep 2007, at 18:53, Maken Seteva wrote:

> Fellow Zopers.
> I have made a slight modification to my intid util by inheriting  
> from IntId and overriding _generateId().
> I do this to be sure that all new created objects will have an  
> incrementing number where
> the first object created gets id 1, the next gets id 2 and so on.  
> This way I get for "free" sorting by
> oldest/newest.

Please do not attach additional "meaning" to intids. The value of an  
object's intid is (and should be) completely irrelevant.

[snip]

> What do you think about this? Is it "safe" to do this, or have i  
> forgotten any unforseen oddities
> that might occur in the future :O

Your code looks like a conflict-magnet to me. I suggest you read up  
on why counting in the ZODB is a bad idea.

Stefan


--
It doesn't necessarily do it in chronological order, though.
   --Douglas Adams




More information about the Zope3-users mailing list