[Zope] hide nested classes in a python products -- how?

Tino Wildenhain tino@wildenhain.de
Tue, 12 Nov 2002 12:57:37 +0100


Hi Tobias,

One solution that comes in mind is to remove the
permission "Add your object type" from everyone
and provide a proxy role in your folderish
product.

Another way would ony be to hack ofs.folder
to make the types of objects configureable.
This would also be nice in regard to mime-types
and ftp upload -> object type mapping

Regards
Tino


--On Dienstag, 12. November 2002 10:32 +0100 Tobias Herp <THerp@apriori.de> 
wrote:

>
> Hi, Tino,
>
> thanks for answering.
>
>>>
> If you only use:
>
> from ZClasses import createZClassForBase
>
> createZClassForBase( base_class=YourProduct.HiddenBaseClass,
> pack=globals()                    , nice_name='YourHiddenBaseClass',
> meta_type='YourHiddenClass' )
>
> you can derive from your class in ZClasses, but they dont show up in
> the add list.
> <<
>
> If I get you right, I'd get again ZClasses. But I don't want ZClasses,
> since it doesn't seem to be possible to get the structure again I had in
> Zope 2.5.1 (consider a ZClass B _contained_in_, _not_ derived from ZClass
> A. It's impossible in Zope 2.6 to define that the only objects allowed in
> ZClass A objects are Bs, because B doesn't show up in the appropriate
> list).
>
> Is there a way to hide python classes, so that they can be added in their
> particular containing objects only?
>
> E.g.:
> Portal
>   (contains) Layout
>     (contains) Site
>       (contains) Page
>
> I know I could throw an exception when the parent object is not of the
> right type, but that seems to me only the second best solution.
>
> --
> (sorry for any unfriendly footer added automatically against my wishes...
> please ignore it!)
>
>