Back to index

plone3  3.1.7
Functions
wicked.at.subscriber Namespace Reference

Functions

def at_handle_target_deletion
def at_handle_target_moved

Function Documentation

Invalidate any pointer before object deletion

Definition at line 19 of file subscriber.py.

00019 
00020 def at_handle_target_deletion(ref, event):
00021     """
00022     Invalidate any pointer before object deletion
00023     """
00024     target = ref.getTargetObject()
00025     for field in ISchema(target).fields():
00026         if IAmWickedField.providedBy(field):
00027             wicked = utils.getWicked(field, target)
00028             wicked.unlink(ref.sourceUID)
00029             break

def wicked.at.subscriber.at_handle_target_moved (   obj,
  event 
)
when a target of a link is moved, or renamed we need to notify any
objects that may be caching pointers

Definition at line 30 of file subscriber.py.

00030 
00031 def at_handle_target_moved(obj, event):
00032     """
00033     when a target of a link is moved, or renamed we need to notify any
00034     objects that may be caching pointers
00035     """
00036     #@@ add more tests
00037     if IObjectRemovedEvent.providedBy(event):
00038         return
00039     
00040     refs=obj.getRefs(relationship=config.BACKLINK_RELATIONSHIP)
00041     path = '/'.join(obj.getPhysicalPath())
00042     for target in refs:
00043         for field in ISchema(target).fields():
00044             wicked = utils.getWicked(field, target)
00045             uid = IUID(obj)
00046             data = dict(path=path,
00047                         icon=obj.getIcon(),
00048                         uid=uid)
00049             wicked.cache.reset(uid, [data])
00050 
00051     

Here is the call graph for this function: