Retrieving a list of items - here and everywhere
by
antonh
—
last modified
07-Sep-06 11:48 AM
There are of course multiple ways to do things. When I first learned how to get a list of items of a particular type from a folder, I was pretty happy. Now I've finally realised that you don't necessarily want to limit yourself to the current folder. What follows is my first unassisted expedition into the ZCatalog.
This is the way to get all the items in a portal:
python:here.contentValues(filter={'portal_type':'News Item'});
This is the catalog query you'll find in the CMF's recent_news object, which gives you all the News Items in the published state in a portal.:
python: here.portal_catalog.searchResults(portal_type='News Item',
sort_on='Date', sort_order='reverse', review_state='published');
Retrieving a list of items - here and everywhere
If you click on "portal_catalog" in the ZMI, then the "Catalog" tab, you'll see which objects are being stored. Click on one of the objects, and a new window will open, showing you all the metadata that is stored for that object.