def __init__(self, context): super(ZCDataProvider, self).__init__(context) catalog = api.get_portal_catalog() # extract the metadata self.keys = catalog.schema() # add specific catalog brain mappings self.attributes.update({ "path": "getPath", }) # ignore some metadata values, which we already mapped self.ignore = [ 'CreationDate', 'Creator', 'Date', 'Description', 'EffectiveDate', 'ExpirationDate', 'ModificationDate', 'Subject', 'Title', 'Type', 'UID', 'cmf_uid', 'getIcon', 'getId', 'getObjSize', 'getRemoteUrl', 'listCreators', 'meta_type', ]
def get_document_brain(self): pc = api.get_portal_catalog() results = pc({"portal_type": "Document", "limit": 1}) return results[0]
def test_get_portal_catalog(self): self.assertEqual( api.get_portal_catalog(), getToolByName(self.portal, "portal_catalog"))
def test_get_portal_catalog(self): self.assertEqual(api.get_portal_catalog(), getToolByName(self.portal, "portal_catalog"))