def isWeblogContent(self, obj=None): """See IBaseView. """ if obj is None: obj = self.context if IWeblog.providedBy(obj): return True elif IWeblogArchive.providedBy(obj): return True elif IWeblogEntry.providedBy(obj): return True elif ITopic.providedBy(obj): return True return False
def getArchivePathForNoArchive(obj, weblog_content): """See IWeblogView. """ weblog_path = weblog_content.getPhysicalPath() if IWeblogEntry.providedBy(obj): obj = obj.context obj_path = getattr(obj, 'getPath', None) if obj_path and callable(obj_path): obj_path = obj.getPath().split('/') else: obj_path = obj.getPhysicalPath() return obj_path[len(weblog_path):]