コード例 #1
0
 def getContext(self):
     context = Acquisition.aq_inner(self.context)
     # if dynamic-pressroom was used on a Document, get the parent-folder
     if IATDocument.providedBy(context):
         context = Acquisition.aq_parent(context)
     context = context.getCanonical()
     return context
コード例 #2
0
ファイル: pressroom.py プロジェクト: EU-OSHA/osha.theme
 def getContext(self):
     context = Acquisition.aq_inner(self.context)
     # if dynamic-pressroom was used on a Document, get the parent-folder
     if IATDocument.providedBy(context):
         context = Acquisition.aq_parent(context)
     context = context.getCanonical()
     return context
コード例 #3
0
 def getContext(self):
     context = aq_inner(self.context)
     # if dynamic-pressroom was used on a Document, get the parent-folder
     if IATDocument.providedBy(context):
         context = aq_parent(context)
     if hasattr(context, 'isCanonical') and not context.isCanonical():
         context = context.getCanonical()
     return context
コード例 #4
0
 def __call__(self):
     purl = getToolByName(self.context, 'portal_url')
     pobj = purl.getPortalObject()
     disc = pobj.get('disclaimer')
     if not disc:
         raise AttributeError(u'Disclaimer Object missing')
     if not IATDocument.providedBy(disc):
         raise AttributeError(u'Unknown Object declared as Disclaimer')
     return disc.getText()