[Erp5-dev] how to get base categories from type information
Jérôme Perrin
jerome at nexedi.com
Mon Aug 14 23:10:37 CEST 2006
Le Lundi 14 Août 2006 22:09, Bartek Gorny a écrit :
> On 14/08/06, Jérôme Perrin <jerome at nexedi.com> wrote:
...
> > 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.
You are 100% right, both ERP5Type.getInstanceBaseCategoryList and
TranslationProviderBase.createInitialPropertyTranslationDomainDict suffer
from this problem.
Afterall, the best way to know the properties / categories of objects created
by a given ERP5TypeInformation is to probably to call its factory method and
introspect the returned object, like does ERP5Type.getInstancePropertyMap.
--
Jérome
More information about the Erp5-dev
mailing list