Back to index

plone3  3.1.7
Public Member Functions | Static Public Attributes
CMFEditions.tests.DummyTools.DummyHistoryIdHandler Class Reference
Inheritance diagram for CMFEditions.tests.DummyTools.DummyHistoryIdHandler:
Inheritance graph
[legend]
Collaboration diagram for CMFEditions.tests.DummyTools.DummyHistoryIdHandler:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def register
def queryUid
def getUid
def queryObject
def getId

Static Public Attributes

string id = 'portal_historyidhandler'
string UID_ATTRIBUTE_NAME = 'editions_uhid'
int uhid_counter = 0
 UniqueIdError = UniqueIdError
dictionary objectRegistry = {}

Detailed Description

Definition at line 384 of file DummyTools.py.


Member Function Documentation

Definition at line 33 of file DummyTools.py.

00033 
00034     def getId(self):
00035         return self.id

Here is the call graph for this function:

Definition at line 407 of file DummyTools.py.

00407 
00408     def getUid(self, obj):
00409         uid = self.queryUid(obj, default=None)
00410         if uid is None:
00411             raise UniqueIdError("'%s' has no unique id attached." % obj)
00412         return uid

Here is the call graph for this function:

def CMFEditions.tests.DummyTools.DummyHistoryIdHandler.queryObject (   self,
  uid,
  default = None 
)

Definition at line 413 of file DummyTools.py.

00413 
00414     def queryObject(self, uid, default=None):
00415         try:
00416             return self.objectRegistry[uid]
00417         except KeyError:
00418             return default
00419 
00420 #    def setUid(self, obj, uid, check_uniqueness=True):
00421 #        setattr(obj, self.UID_ATTRIBUTE_NAME, uid)

Here is the caller graph for this function:

def CMFEditions.tests.DummyTools.DummyHistoryIdHandler.queryUid (   self,
  obj,
  default = None 
)

Definition at line 404 of file DummyTools.py.

00404 
00405     def queryUid(self, obj, default=None):
00406         return getattr(aq_base(obj), self.UID_ATTRIBUTE_NAME, default)

Here is the caller graph for this function:

Definition at line 395 of file DummyTools.py.

00395 
00396     def register(self, obj):
00397         uhid = self.queryUid(obj)
00398         if uhid is None:
00399             self.uhid_counter += 1
00400             uhid = self.uhid_counter
00401             setattr(obj, self.UID_ATTRIBUTE_NAME, uhid)
00402             self.objectRegistry[uhid] = obj
00403         return uhid

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

string CMFEditions.tests.DummyTools.DummyHistoryIdHandler.id = 'portal_historyidhandler' [static]

Definition at line 385 of file DummyTools.py.

Definition at line 393 of file DummyTools.py.

Definition at line 389 of file DummyTools.py.

Definition at line 387 of file DummyTools.py.

Definition at line 391 of file DummyTools.py.


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