ObjectManager question.
Hi people, I just started playing with python products, and I have a question that I can't seem to solve: I have a class derived from ObjectManager, how do I create a "Contents" tab, so that it looks like a folder and lets the user put other objects in it? What do I have to put in the manage_options? I guess there is something already defined for this, but I can't find it in the docs. Thanks!!!! |G|
I recommend subclassing off both the Object Manager and the Folder. You get the look of a folder and the ability to control the objects in it. I find this workd best if you do the correct order "ObjectManager, Folder" Tom => -----Original Message----- => From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of => giovanni@simplesky.com => Sent: Saturday, 8 September 2001 7:47 AM => To: zope@zope.org => Subject: [Zope] ObjectManager question. => => => Hi people, I just started playing with python products, and => I have a question that I can't seem to solve: => => I have a class derived from ObjectManager, how do I => create a "Contents" tab, so that it looks like a folder => and lets the user put other objects in it? => What do I have to put in the manage_options? => => I guess there is something already defined for this, => but I can't find it in the docs. => => Thanks!!!! => => => |G| => => => _______________________________________________ => Zope maillist - Zope@zope.org => http://lists.zope.org/mailman/listinfo/zope => ** No cross posts or HTML encoding! ** => (Related lists - => http://lists.zope.org/mailman/listinfo/zope-announce => http://lists.zope.org/mailman/listinfo/zope-dev ) =>
I recommend subclassing off both the Object Manager and the Folder. You get the look of a folder and the ability to control the objects in it. I find this workd best if you do the correct order "ObjectManager, Folder"
Given that Folder sublcasses ObjectManager, this is probably totally unneccessary ;-) Chris
That is interesting, I find if I subclass off Folder only then I dont get to see the SubObject Tab in the ZClass management area. I have to subclass off ObjectManager also to see this tab. Could I be doing something wrong? Tom => -----Original Message----- => From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Chris => Withers => Sent: Saturday, 8 September 2001 7:09 PM => To: Tom Cameron; giovanni@simplesky.com; zope@zope.org => Subject: Re: [Zope] ObjectManager question. => => => > I recommend subclassing off both the Object Manager and the Folder. => > You get the look of a folder and the ability to control the => objects in it. => > I find this workd best if you do the correct order => "ObjectManager, Folder" => => Given that Folder sublcasses ObjectManager, this is probably totally => unneccessary ;-) => => Chris => => => _______________________________________________ => Zope maillist - Zope@zope.org => http://lists.zope.org/mailman/listinfo/zope => ** No cross posts or HTML encoding! ** => (Related lists - => http://lists.zope.org/mailman/listinfo/zope-announce => http://lists.zope.org/mailman/listinfo/zope-dev ) =>
zClasses seem very cool...but, constantly trip me up as a newbie. Unexpected behavior with zClasses. I redid the property sheet in an existing zClass, which affected the "views tabs". The old zClass objects do not show the new "view tabs" in their management view. They only show [Edit] and [Contents]. Oddly, clicking [Contents] shows the new views tabs, but they dont work...?!! The "new" zClass objects I created work as they should... Why has this happened? Do I have to redo my old zClass objects, or is there a workaround? So far, zClasses seem extremely unforgiving. I have yet to successfully rebase one. Thanks as always, -Trevor
zClasses seem very cool...but, constantly trip me up as a newbie. Unexpected behavior with zClasses.
...which is why I think ZClasses suck :-( Learn to write python products, more powerful, more logical, less hassle... Chris
Chris, I am trying to get there as fast as I can! Hence the weekend posts. I am in production mode while trying to learn this stuff... Right now, zClasses seem to be my only choice until I can learn more Python. Your continued feedback is helping ease this pressure and transition. ;) Thanks -Trevor
-----Original Message----- From: Chris Withers [mailto:chrisw@nipltd.com] Sent: Sunday, September 09, 2001 4:19 AM To: Trevor Toenjes; Tom Cameron; zope@zope.org Subject: Re: [Zope] A different ObjectManager question regarding zClasses.
zClasses seem very cool...but, constantly trip me up as a newbie. Unexpected behavior with zClasses.
...which is why I think ZClasses suck :-(
Learn to write python products, more powerful, more logical, less hassle...
Chris
Trevor Toenjes writes:
I redid the property sheet in an existing zClass, which affected the "views tabs". Not sure, what you mean with "view tabs"...
The old zClass objects do not show the new "view tabs" in their management view. They only show [Edit] and [Contents]. Oddly, clicking [Contents] shows the new views tabs, but they dont work...?!! I just tried it:
I added a new view in the ZClass's "Views" tab, made it the first view and looked at an old instance. As expected (and hoped for), the old instances have the new view. And the view works. Thus, I cannot reproduce your findings (ZopeCVS, Python 2.1.1, Linux2).
Why has this happened? Do I have to redo my old zClass objects, or is there a workaround? There is one issue:
If you modify the default property value in a ZClass after you modified in an instance another property governed by the same property sheet, then the new default value may not show up in this instance. The reason is simple: When the "editPropertySheetForm" is submitted, it sends values for all properties not just the modified ones. "manage_changeProperties" instantiates all these values into the instance. From then on, the default value provided by the class is no longer relevant, because the instance has its own value.
So far, zClasses seem extremely unforgiving. I have yet to successfully rebase one. You read the list (not only your own posts and replies)? This was recently discussed. It is possible (HowTo on "zope.org" and mailing list archives), although not easy.
Dieter
I find if I subclass off Folder only then I dont get to see the SubObject Tab in the ZClass management area. I have to subclass off ObjectManager also to see this tab.
Hmmm :-S I never figured this out either...
Could I be doing something wrong?
Using ZClasses? ;-) Chris
Tom Cameron writes:
That is interesting, I find if I subclass off Folder only then I dont get to see the SubObject Tab in the ZClass management area. I have to subclass off ObjectManager also to see this tab.
Could I be doing something wrong? No, you do not.
Apparently, there are two different "ObjectManager" classes. One that "Folder" subclasses, without "Subobject" tab, and one available as base class for ZClasses with this tab. I was unaware of this "name clash" and, as Chris did, suggested once to simply subclass from "Folder" and omit "ObjectManager". Now, I see (from your post), that this is not true for ZClasses. Dieter
participants (5)
-
Chris Withers -
Dieter Maurer -
giovanni@simplesky.com -
Tom Cameron -
Trevor Toenjes