[Zope-dev] ZClass nesting/adding desperation

Jason Spisak 444@hiretechs.com
Fri, 21 Apr 2000 16:15:21 GMT


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.