Re: [Zope-dev] ZClass nesting/adding desperation
Rik,
I had the exact same problem with a recent design. My very first design using ZClasses when they first came out, I put all classes in the root of my product. This made the management interface for "Folders" tough, but that was the only sacrifice really. (All those messy meta_types) But I used the "Subobjects" tab and made sure only certain objects could be added quite nicely to my other ZClasses.
Also the flexibility for extending this design was better that the one I laid out using "nested" ZClasses. It turned out that whatever level you nested a ZClass that was it's level of creation and inheritance. That was very tricky to design around.
I am now back to using my first method (all ZClassses under the product). But I recently discovered a bug that has been reported by Alexandre and a few others. If you don't subclass ObjectMangaer in your "Base" ZClasses, and you create subclasses off of you own non-ObjectManager Bases, they never show up in the management interface or any objectValues(), etc... Because I didn't do this, and it is bad juju to change the ZClass Base Classes, I have started to look into creating straight Python Products.
That's my experience and I hope it helps.
Thanks Jason, I already came to the conclusion that a 'flattened' design was probably the best option. Technically a python product is probably even better. I want to be this a web (read ZClasses) only, product so that it is easily customizable. Ease of management through the web and flexibilty are the main assets of the thing (in contrast to the existing commercial web educational packages). Therefore a ZClasses solution is the only way to go I think. By way of background: this is a product that is to be used for managing an educational site (containing a management layer, a design layer and a flexible web course layer). There are already a zillion methods and properties inside the product and I was reluctant to change it in fear both of breaking things and of getting behind in getting the damn thing out. But I think that is the only option (sigh). Thanks for your help and for thinking along, though. Rik
Rik,
Technically a python product is probably even better. I gave it a try and it went pretty easily. Which brings me to you next thought...
I want to be this a web (read ZClasses) only, product so that it is easily customizable. Ease of management through the web and flexibilty are the main assets of the thing (in contrast to the existing commercial web educational packages). Therefore a ZClasses solution is the only way to go I think.
I decided the same here, for the same web-isized reasons. I am managing another large project that is currently in use, and nothing beats the ability to make a few changes via the web and give them exactly the change they wanted.
By way of background: this is a product that is to be used for managing an educational site (containing a management layer, a design layer and a flexible web course layer).
Sounds great and useful.
There are already a zillion methods and properties inside the product and I was reluctant to change it in fear both of breaking things and of getting behind in getting the damn thing out. But I think that is the only option (sigh).
I just started rebuilding mine yesterday too. I just figured I'd better bite it now, rather that wait. One thing I found though, is that when you create an instance of a ZClass progarmatically, and then you wnat to automatically create an instance of a ZClass inside that inthe same method, you can't use: <dtml-with "manage_addProduct['MyProduct']"> <dtml-with "ParentClass.createInObjectManager(REQUEST['id'], REQUEST)"> <dtml-call "propertysheets.myProperties.manage_editProperties(REQUEST)"> <dtml-with "ContactClass.createInObjectManager(REQUEST['contact'], REQUEST)"> <dtml-call "propertysheets.Contact.manage_editProperties(REQUEST)"> <dtml-call reindex_object> </dtml-with> <dtml-call reindex_object> </dtml-with> </dtml-with> It will create both instances in the same object, even though you included a 'with' for the created object! Bug? Anyone else think this is a bug? You have to grab the 'id' from the instance you want to put something inside, and then create the instance inside of that object like this: <dtml-with "manage_addProduct['MyProduct']"> <dtml-with "ParentClass.createInObjectManager(REQUEST['id'], REQUEST)"> <dtml-call "propertysheets.myProperties.manage_editProperties(REQUEST)"> <dtml-call reindex_object> </dtml-with> </dtml-with> <dtml-with "_[REQUEST['id']]"> <dtml-with "manage_addProduct['ZGL']"> <dtml-with "BabyClass.createInObjectManager(REQUEST['contact'], REQUEST)"> <dtml-call "propertysheets.babyProps.manage_editProperties(REQUEST)"> <dtml-call reindex_object> </dtml-with> </dtml-with> </dtml-with> Pain in my ass. All my best, Jason Spisak CIO HireTechs.com 6151 West Century Boulevard Suite 900 Los Angeles, CA 90045 P. 310.665.3444 F. 310.665.3544 Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email address may not be added to any commercial mail list with out my permission. Violation of my privacy with advertising or SPAM will result in a suit for a MINIMUM of $500 damages/incident, $1500 for repeats.
participants (2)
-
Jason Spisak -
Rik Hoekstra