Пример #1
0
    def msgEmptyTable(self):
        context = self.context
        if IWorkspaceContentType.providedBy(context):
            principal = context.__parent__.__parent__.principal
        else:
            principal = context.__parent__.principal

        if principal.id == self.request.principal.id:
            return _(u'You do not have any content.')
        else:
            return _(u'He/she does not have any content.')
Пример #2
0
    def initDataset(self):
        context = self.context

        if IWorkspaceContentType.providedBy(context):
            types = (context.__name__,)
            principal = context.__parent__.__parent__.principal
        else:
            principal = context.__parent__.principal
            types = [name for name, ct in getUtilitiesFor(IDraftContentType)]

        self.dataset = getUtility(ICatalog).searchResults(
            sort_on = 'modified', sort_order='reverse',
            owners = {'any_of': (principal.id,),},
            type = {'any_of': types},
            draftContent = {'any_of': (False,)})
Пример #3
0
    def initDataset(self):
        context = self.context

        if IWorkspaceContentType.providedBy(context):
            container = context.__parent__['draft']

            drafts = []
            ctname = context.__name__
            for draft in container.values():
                dct = IContentType(draft, None)
                if dct is None:
                    continue
                if ctname and (dct.name != ctname):
                    continue
                drafts.append(draft)
            self.dataset = drafts
        else:
            container = context['draft']
            self.dataset = list(container.values())