[Zope-CMF] Help on catalog query

Tres Seaver tseaver@zope.com
Sun, 17 Mar 2002 20:51:00 -0500 (EST)


On Sun, 17 Mar 2002, Florent Guillaume wrote:

> Andrew Sawyers <andrew@zope.com> wrote:
> > If you just want to return back brains objects, the following
> > worked for me in the debugger:
> > types = ['ItemType1', 'ItemType2']
> > catalog = root.portal.portal_catalog
> > res = []
> > for t in types:
> >     res.append(catalog(Type=t))
> 
> Ah, this reminds me: another weird thing IMHO in CMF, is that Type is
> catalogged but Type is the human-readable version (the title). It
> would be much better if Metatype (content_meta_type) was
> catalogged. Also the allowed_content_types variable in a
> TypeInformation contains this human-readable version, which means that
> whenever you change the title you have to go through all your types
> and reselect the new one in the "Allowed content types".

We can't use the metatype:  that may not be unique across different
type information objects based on the same underlying Python class.
The DublinCore.Type query should return the ID of the type information
object, which is what we want to be querying on, I think.

-- 
===============================================================
Tres Seaver                                tseaver@zope.com
Zope Corporation      "Zope Dealers"       http://www.zope.org