[Zope] The scope of a Zclass CreateInObjectManager call?

Larry Groebe lgroebe@Insidermarketing.com
Tue, 05 Jun 2001 17:39:45 -0500


OK, so I'm a newbie. Been working with Zope for about two weeks.
On most problems, I usually find that I know what I WANT to do, then
struggle mightily with Zope/Python syntax for half a day, then produce the
2-3 powerful lines of DTML that do exactly what I want.

Not this time. This time, I'm really stumped.

I've built a class. Works fine. Now I'm trying to enhance it.
I want instances of this class to be created one folder DOWN from wherever
the user asks to add an object. Which folder depends on one of the
fields/properties in the instance being added. (for context, this is a
tracking system of jobs and clients. I want to create a (class instance id)
of job "5240" *inside* an "Adobe" folder, creating "Adobe" first if it
doesn't exist.

So why wouldn't something like this work as my "_add" method?

  <dtml-call "manage_addFolder(Client,'')">
  <dtml-with "_[Client]">
  <dtml-with "JobTicket.createInObjectManager(REQUEST['id'], REQUEST)">
  </dtml-with>
  </dtml-with>

The way I see it, that should push the newly built "client" folder onto the
namespace, and create the new job inside of that. Instead, it puts both the
folder and the jobticket instance in the common "jobs" parent folder.

I've spent hours looking in the mailing archives, the how-tos, the source
code - and I'm lost. What am I missing?

--Larry Groebe
  Insider Marketing