[Zope-dev] Manipulating Meta-Type Global Add list on per-instance basis
Josh Zeidner
jmz_phylogenic@hotmail.com
Wed, 01 Mar 2000 18:20:25 EST
Hi Tres,
I Am currently using the scheme that I explained in previous postings in
an ZClass derived from Object mangager. However, I am facing one small
problem. If the ZClass is defined to have *NO* allowable subobjects, adding
any meta-types through my code has no effect. If the ZClass is defined to
have at least one allowable sub-type, then everything behaves properly. It
is my contention that when the first Meta-Type is added through the
"subobjects" tag, something else is happening that I am not reproducing in
my code, so...
1) Do you think this assumption is correct?
2) What is it that I am missing from my code?
thanks for all the help... Josh Zeidner
>Josh Zeidner wrote:
> >
> > Hmm... possibly I did not explain my needs :
> >
> > What I need to do is manipulate the attribute of a "folderish" object
>(
> > ie. an object that can contain other objects ) that determines what
>objects
> > are allowed to be contained by my object. I need to do this at
> > instantiation time , *NOT* definition time.
>
>That is what I was targeting -- I guess my implementation wasn't limpidly
>transparent.
>
> >
> > I seemed to have accomplished this by manipulating the "meta_types"
> > attribute... but is this a valid way to attain this behavior?
>
>That is a more straightforward option than I proposed below -- my code
>_filters_
>the available meta_types based on a tokens/list instance property -- the
>catch
>is that you have to replace the standard "contents" view in order to get my
>code
>used (I am not really changing what _could_ be added; I merely change the
>list
>presented to the user.)
>
>Munging the meta_types attribute is actually an interesting idea --
>"normal"
>Python product objects have the meta_types attribute as a class member; so
>in
>fact, you are "hiding" the class member when you assign to the instance
>attribute. If you ever want to "recover to original," you should be able
>to
>just "del self.meta_types" hand have it reappear, presto-changeo.
>
>Glad you found a solution.
>
>Tres.
>--
>=========================================================
>Tres Seaver tseaver@palladion.com 713-523-6582
>Palladion Software http://www.palladion.com
>
>_______________________________________________
>Zope-Dev maillist - Zope-Dev@zope.org
>http://lists.zope.org/mailman/listinfo/zope-dev
>** No cross posts or HTML encoding! **
>(Related lists -
> http://lists.zope.org/mailman/listinfo/zope-announce
> http://lists.zope.org/mailman/listinfo/zope )
>
______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com