[Zope3-Users] Looking up the schema of an adapter?

Alec Munro alecmunro at gmail.com
Sat Jan 7 13:46:53 EST 2006


Hi List,

I'm building an e-commerce system, and within it, I have "Deliverable"
objects, and "ProductOrder" objects. A ProductOrder is currently
treated as an adapter to a Deliverable, it represents an order for
that Deliverable. There are a number of different Deliverable types,
most with corresponding ProductOrder types (I use ZCML to register
each ProductOrder as an adapter to each Deliverable type). The
ProductOrder types have common properties, such as quantity of items
ordered, and unique properties, such as color, or language.
What I want to be able to do is lookup the schema of a ProductOrder
from the context of the corresponding Deliverable, for the purpose of
creating an add form for that ProductOrder. Currently, I can
accomplish this by actually instantiating a ProductOrder as an adapter
to the Deliverable, and then looking at __implemented__.declared, but
then the ProductOrder get discarded, and reinstantiated when the Add
Form is submitted.

I would like a straightforward way to lookup the schema and create the
Add Form without having to instantiate the ProductOrder.
Alternatively, if anyone can suggest any modifications to my overall
system that will allow me the same functionality, that would be great.

Thanks,

Alec Munro


More information about the Zope3-users mailing list