Back to index

plone3  3.1.7
upgrade.py
Go to the documentation of this file.
00001 from Products.CMFCore.utils import getToolByName
00002 from Products.Five.utilities.marker import mark
00003 from wicked.at import config
00004 from wicked.interfaces import IWickedBacklink 
00005 from wicked.interfaces import IWickedTarget
00006 
00007 def upgrade09(site):
00008     refcat = getToolByName(site, 'reference_catalog')
00009     refs = (brain.getObject() for brain in \
00010                refcat(relationship=config.BACKLINK_RELATIONSHIP))
00011     
00012     for ref in refs:
00013         if ref:
00014             obj=ref.getSourceObject()
00015             mark(obj, IWickedTarget)
00016             if not IWickedBacklink.providedBy(ref):
00017                 print ref
00018                 mark(ref, IWickedBacklink)