[Zope-dev] ZPatterns Project Help!
bens@killersite.com
bens@killersite.com
Wed, 22 Nov 2000 10:21:19 -0500
Thanks for answering Steve.
Unfortunitly I am working with version 0.3 of ZPatterns so I have
to use GAP.
When I try to translate your Skinscript into GAP like this
"attrsexprs:account_object=(RESULT is _.None) and NOT_FOUND or
RESULT" and I try to access the object's id with <dtml-var
"account_object.id"> I get a "NameError" on account_object.
Alternativly if I do <dtml-var account_object> I get a "KeyError".
(BTW. for testing I used "accounts.getItem('1434')" which is a
valid object. If I do "account_object=RESULT.id" it works fine.)
I appreciate any help on this.
-Ben
>>>>>>
Hi Ben,
GAPs are sort of deprecated at this point in favor
of SkinScript. In SkinScript you might do something like this:
WITH accounts.getItem(self.account_id) COMPUTE
account_object=RESULT
or more carefully...
WITH accounts.getItem(self.account_id) COMPUTE
account_object=(RESULT is _.None) and NOT_FOUND or RESULT
-steve
>>>>> "bentzion" == bentzion <bentzion@bellatlantic.net> writes:
bentzion> Another question... bentzion> I want to have a
GAP that will add some other Object to
bentzion> an attribute of my DataSkin. This is what I have
tried