Back to index

plone3  3.1.7
Public Member Functions | Static Public Attributes | Private Attributes | Static Private Attributes
CMFUid.UniqueIdGeneratorTool.UniqueIdGeneratorTool Class Reference
Inheritance diagram for CMFUid.UniqueIdGeneratorTool.UniqueIdGeneratorTool:
Inheritance graph
Collaboration diagram for CMFUid.UniqueIdGeneratorTool.UniqueIdGeneratorTool:
Collaboration graph

List of all members.

Public Member Functions

def __init__
def __call__
def convert

Static Public Attributes

string id = 'portal_uidgenerator'
string alternative_id = 'portal_standard_uidgenerator'
string meta_type = 'Unique Id Generator Tool'
tuple security = ClassSecurityInfo()

Private Attributes


Static Private Attributes

tuple __implements__

Detailed Description

Generator of unique ids.

This is a dead simple implementation using a counter. May cause
ConflictErrors under high load and the values are predictable.

Definition at line 32 of file

Constructor & Destructor Documentation

Initialize the generator

Definition at line 52 of file

00053     def __init__(self):
00054         """Initialize the generator
00055         """
00056         # The previous ``BTrees.Length.Length`` implementation may cause 
00057         # double unique ids under high load. So for the moment we just use 
00058         # a simple counter.
00059         self._uid_counter = 0

Member Function Documentation

See IUniqueIdGenerator.

Definition at line 61 of file

00062     def __call__(self):
00063         """See IUniqueIdGenerator.
00064         """
00065         # For sites that have already used CMF 1.5.1 (and older) the
00066         # BTrees.Length.Length object has to be migrated to an integer.
00067         if isinstance(self._uid_counter, Length):
00068             self._uid_counter = self._uid_counter()
00069         self._uid_counter += 1
00070         return self._uid_counter

Here is the caller graph for this function:

See IUniqueIdGenerator.

Definition at line 72 of file

00073     def convert(self, uid):
00074         """See IUniqueIdGenerator.
00075         """
00076         return int(uid)
00078 InitializeClass(UniqueIdGeneratorTool)
00079 registerToolInterface('portal_uidgenerator', IUniqueIdGenerator)

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

Initial value:

Definition at line 41 of file

Definition at line 58 of file

string CMFUid.UniqueIdGeneratorTool.UniqueIdGeneratorTool.alternative_id = 'portal_standard_uidgenerator' [static]

Definition at line 46 of file

string = 'portal_uidgenerator' [static]

Definition at line 45 of file

string CMFUid.UniqueIdGeneratorTool.UniqueIdGeneratorTool.meta_type = 'Unique Id Generator Tool' [static]

Definition at line 47 of file

Definition at line 49 of file

The documentation for this class was generated from the following file: