[Erp5-dev] how to get base categories from type information

Bartek Gorny bartek at redpoint.mn.pl
Mon Aug 14 22:09:19 CEST 2006


On 14/08/06, Jérôme Perrin <jerome at nexedi.com> wrote:
> Le Lundi 14 Août 2006 16:25, Bartek Gorny a écrit:
> > Hello
> >
> > Anybody knows how to do this: get a list of base categories for a
> > portal_type from the Type Information?
> >
> > The point is to get something like what you can get from an instance
> > (by object.getBaseCategoryList()), but not from an instance, but from
> > a portal type definition - like collecting all property sheets hooked
> > to it and adding base categories assigned from ZMI. I'm sure there is
> > a way to do it, but can't figure out how. Can you help?
>
> ERP5Type.getInstanceBaseCategoryList have been added very recently for this
> purpose, but this is still unstable API.

Almost, but not quite - the function is looking for class ("klass") by
deriving its name from the name of the portal type - which works as
long as they are the same. But they can be different, if you have
multiple portal types from the same class - then you don't get any
property sheets.

Bartek

> --
> Jérome
>


-- 
"Software is largely a service industry operating under the persistent
but unfounded delusion that it is a manufacturing industry."
Eric S.Raymond, "The Magic Cauldron"



More information about the Erp5-dev mailing list