(I've realized that I've sent this reply only to Wichert, not to the list)
Thamk you, Wichert.
Might I ask why you want to do this?
In a Plone product A I defined a data model with a hierachy of classes (*),
some corresponding to portal types and others being only abstract
superclasses.
A tool was reasoning on said data model for, among other things
- building a synoptic panel showing the hierarchy of abstract and concrete
classes, instance counts, aso
- identifying schema fields common to all portal_types derived from a
certain abstract or concrete superclass
- as a result of the above, generating automatically the best query forms
for each (abstract or concrete) class.
Now, I'm trying to extend the data model for another application, with an
ADDITIONAL Plone product, B
- defining new classes and portal types
- defining new relationships relating both existing and new portal types.
Currently the tool in product A is only aware of classes/types defined by
the product itlself.
I want to modify some of its methods making them more general, not making
the tool also aware of classes/types in product B.
(*) I developed most of product A using AGX; I'm developing the product B by
hand; but this isn't relevant.
Best regards, Giovanni
----- Original Message -----
From: "Wichert Akkerman" <[email protected]>
To: "Giovanni Toffoli" <[email protected]>
Cc: <[email protected]>
Sent: Thursday, July 16, 2009 11:06 AM
Subject: Re: [Product-Developers] From a portal_type to the python class
On 7/16/09 10:32 AM, Giovanni Toffoli wrote:
Hi all,
I'm not able to find a clean way to get the class (the class object, not
only its name) implementing a portal_type.
In the past I followed a dirty approach, based on the portal_types tool
and relying on the assumptions that
- the name of the class was the same than the name of the portal type
- each class was defined in a separate module, with the same name than
the portal type, in the product registering the portal type.
I suppose that a more general method is available. Could somebody help
me?
There is no good way to do that, since a portal type essentialy maps to a
function which generates an object. There is no direct portal type to
python class type relation.
Might I ask why you want to do this?
Wichert.
_______________________________________________
Product-Developers mailing list
[email protected]
http://lists.plone.org/mailman/listinfo/product-developers