[Zope-CMF] adding two types with different permissions

kapil thangavelu kthangavelu@earthlink.net
Wed, 31 Jul 2002 11:51:58 -0700


okay on further reflection there seem to be two ways to do this.

1. install the composite factory type info on the persistent product object 
itself during the product's initialize method, ie

    context._ProductContext__prod.factory_type_information = composite_fti

this seems hackish, and i wish there were a cleaner way to expose this.

2. during all calls to ContentInit, always pass a composite factory type 
info. iotw, the fti will be the same during all calls to ContentInit. this 
has the effect of overwriting the factory dispatcher factory type information 
attribute, but always with the correct information.

by composite fti, i mean a tuple of factory type informations consisting of 
all ftis that will be registered by the product.

please take note of the warning in my other email regarding separate 
constructors and removing the product from the control panel.

-k

On Wednesday 31 July 2002 03:52 pm, Karl Anderson wrote:
> kapil thangavelu <kthangavelu@earthlink.net> writes:
> > On Monday 29 July 2002 12:53 pm, Karl Anderson wrote:
> > > I'm trying to add two types from the same Zope product.  Because I
> > > want separate permissions for each's constructors, I'm using two
> > > ContentInit calls.  However, this isn't working.
> >
> > short answer, as far as i can tell, it isn't possible. the long answer,
> > is infinitely more ugly.
>
> Well, Dieter Maurer and Evan both posted example code (with two
> ContentInit calls for two types in one __init__.py).
>
> Does anyone have a working example with real code?