[Zope] How to make two racks work under one specialist?

Steve Spicklemire steve@spvi.com
Fri, 29 Dec 2000 08:32:18 -0500 (EST)


Hi Dirksen,

   I think the problem you are having has to do with using 'getItem'.

From the SkinScriptSyntax Wiki page:

"If the RESULT is NOT_FOUND, the search for the attribute value falls
through to the next declaration (or attribute provider if the SkinScript
is finished). If there is an OTHERWISE LET clause, the assignments given
there are computed and cached for the remainder of the (sub)transaction..."

This is meant to work automatically for "WITH QUERY ... COMPUTE" scripts,
but in your case the RESULT was _.None, so the test for NOT_FOUND
didn't work. I think you could in principle set up a chain of 
attribute providers:

WITH Deliverables.getItem(self.id) COMPUTE theStandInObject=RESULT or NOT_FOUND

then

WITH self.theStandInObject COMPUTE name OTHERWISE_LET name='not availble'

so that if RESULT is _.None from Deliverables.getItem, then the
'StandIn' will be NOT_FOUND and the COMPUTE will fall through to
the 'OTHERWISE LET' clause. However I don't think this works well when
the existance of the virtual object in the Rack depends on 'theStandInObject'
being found.... if theStandInObject is NOT_FOUND then the Rack returns
_.None and you're out of luck. Here's a thought...  what if you put a 
'dummy' object somewhere accessable and did this:

WITH Deliverables.getItem(self.id) COMPUTE theStandInObject=RESULT or theDummyObject

then you could set all the attributes of theDummyObject to be whatever you
wanted....  and you would never get a RESULT of NOT_FOUND.

-steve

>>>>> "Dirksen" == Dirksen  <dirksen_lau@yahoo.com> writes:

    Dirksen> Hi Steve,

    Dirksen> It works! Thank you.

    Dirksen> Still there's a couple of things to be cleared. What's
    Dirksen> the use of 'otherwise' clause? And is it true that the
    Dirksen> 1st 'with' clause fails, the whole skinscript process
    Dirksen> fails (so one 'with' clause is all one skinscript can put
    Dirksen> up with)?

    Dirksen> Dirksen



    Dirksen> __________________________________________________ Do You
    Dirksen> Yahoo!?  Yahoo! Photos - Share your holiday photos
    Dirksen> online!  http://photos.yahoo.com/