[Zope-dev] ZPatterns: SAVING doesn't tolerate missing attributes

Steve Spicklemire steve@spvi.com
Sat, 6 Jan 2001 12:32:00 -0500 (EST)


Hi Steve,

   Could you let some other value represent no car? (e.g., _.None?).

untested... 

WITH CompanyCars.getCar(self.car_id) or NOT_FOUND COMPUTE
   car=RESULT,
   car_registration=registration
OTHERWISE LET
   car=_.None
   car_registration="no car"

WHEN OBJECT CHANGED CALL
   HAS_CHANGED('car_id') and
   (self.car_id and CompanyCars.getItem(self.car_id).decommission(),
    ORIGINAL['car_id'] and (OLD['car'] and OLD['car'].commission()))
SAVING car

Would that work?

-steve

>>>>> "SA" == Steve Alexander <steve@cat-box.net> writes:

    SA> In SkinScript such as

    SA>    WHEN eventspec CALL expression SAVING mementolist

    SA> if any of the mementos in mementolist are not found, the
    SA> script raises a KeyError.