You are not logged in Log in Join
You are here: Home » Members » gtk » ZClasses, ObjectManagers and containers: avoiding the resource not found bug

Log in
Name

Password

 

ZClasses, ObjectManagers and containers: avoiding the resource not found bug

When trying to implement ZClasses that contain other ZClasses in Zope 2, you'll rapidly run into a bug in which you can't create an object inside a container because whenever you click the Add button, a "resource not found" error occurs.

Worse, semi-random clicking might fix the problem without you knowing why.

Spending a few hours trawling the mailing lists will give you the solution, but to save time -- hopefully this will be indexed and you'll trip over it when running some of the more obvious keywords through the zope.org search engine -- here it is:

  1. Create a Product.
  2. Create a ZClass (Class1).
  3. In Class1, create a ZClass (Class2).
  4. Go back to Class1 and open the "Permissions" tab. Highlight "Add Class2". Click Change.
  5. Go back to the "Methods" tab. Open "Class2_factory". Click Change (without changing anything).
  6. Go to the root of your Zope installation and add Class1. Open Class1 and click Add.

The key is step 5. That's the one you might do by accident.

Full credit to: Nick Garcia for the solution. All I'm doing here is making it into a How-To.