[Zope] setting up a ZClass - base class of PropertyManager? plus weird gradual broken product messages

Steve Spicklemire steve@spvi.com
Mon, 22 Apr 2002 20:39:37 -0500


Hi Am,

ZClasses have "propertsheets" already.. so you shouldn't really need to 
inherit from PropertyManager. Also.. changing ZClasses by deleting and 
recreating is a sort of "last ditch" scenario and likely to cause 
problems. You're probably better off deleting all your old instances and 
starting over. This is one of the "major problems" with ZClasses that 
makes so many developers nervous about them. Having said all that, I 
still find them useful in conjunction with a product like ZPatterns that 
permits you to keep the actual data/relations in SQL or LDAP or whatever.

-steve

On Saturday, April 20, 2002, at 03:52 PM, A M Thomas wrote:

> Hello there, and thank you very much in advance for any help.
>
> I'm working on my Zope (2.5.0) product through the management interface,
> and realized that if I just created a ZClass with base classes of
> ObjectManager and CatalogAware, I couldn't add properties to it :(  So,
> I went to re-create my ZClass - and discovered that PropertyManager
> isn't in the list of selectable base classes.  Why is this?  Is there
> some way I can inherit directly from PropertyManager?
>
> I went ahead and created it with an additional base class of
> DTMLDocument, since it's got PropertyManager as one of its base classes,
> but this isn't what I really want -- in addition to being slightly
> inelegant, now the manage_findForm method doesn't appear in the
> available methods for creating Views.
>
> Must I create my product in Python only to get PropertyManager cleanly?
> Would this even work?  And would converting be easy?
>
> Also, I noticed a curious effect: I re-created my ZClass by moving all
> the methods into a temp ZClass, renaming the add and addform methods,
> and saving out the Class ID, then deleting the ZClass and the remaining
> constructor objects (Permission, and Factory).  Then I created a new
> ZClass with the same name as the old one, and put in the saved ClassID,
> replaced the new Add and Addform methods with my original ones (by
> deleting the new ones and renaming the original ones back to their
> original names), and pasting in the methods again.
>
> However, old instances of this ZClass _gradually_ started showing
> "broken product" messages.  First one, then overnight, two more - and
> the first one didn't seem to change immediately.  They shouldn't be
> broken anyway, right?  Is there some known issue about deleting and
> re-creating ZClasses in a product?  To make matters even more
> interesting, now one of them isn't broken anymore.  Yes, I've re-created
> this ZClass more than once today, and this isn't a good diagnostic
> report, I know, but I just wanted to know if anyone knew what might be
> going on based on similar past experience.
>
> Thanks,
> Am
>
>
>
> _______________________________________________
> 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 )