Re: [Zope-dev] ZPatterns Project Help!

2000-11-22 Thread Steve Spicklemire


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  [EMAIL PROTECTED] 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
bentzion with no success.

bentzion fromexpr: accounts.getItem(self.account_id) attrsexprs:
bentzion account_object=RESULT

bentzion This way in my UI Methods in my DataSkin I can access
bentzion (and change) the attributes of "account_object".

bentzion Q. How can I do this? Should I be doing this in a
bentzion different/better way?

bentzion Thanks, -Ben


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




RE: [Zope-dev] ZPatterns Project Help!

2000-11-22 Thread bentzion

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  [EMAIL PROTECTED] 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




___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




RE: [Zope-dev] ZPatterns Project Help!

2000-11-22 Thread Phillip J. Eby

At 10:21 AM 11/22/00 -0500, [EMAIL PROTECTED] wrote:
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.)


Perhaps this is a security issue?  When you set account_object=RESULT.id,
then the account_object attribute is a string, and has no security
protection from access by DTML.  When it is an object, however, your DTML
must have permissions to the object itself.  I am not positive, but I think
ZPatterns 0.3 may have executed GAP expressions as the superuser, so it may
be that your GAP is able to access the object, but not the DTML which is
using the DataSkin.


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




[Zope-dev] ZPatterns Project Help!

2000-11-21 Thread bentzion

Another question...

I want to have a GAP that will add some other Object to an 
attribute of my DataSkin. This is what I have tried with no 
success.

fromexpr: accounts.getItem(self.account_id)
attrsexprs: account_object=RESULT

This way in my UI Methods in my DataSkin I can access (and change) 
the attributes of "account_object".

Q. How can I do this? Should I be doing this in a different/better 
way?

Thanks,
-Ben





___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




[Zope-dev] ZPatterns Project Help!

2000-11-18 Thread Ben Schochet

I am trying to create a ZPatterns based project and have a few question. I
am trying to create an application that can consist of thousands of object
without running into the ZODB size problems.

* It seems that I need to have separate Racks for each Class that I want to
store with ZPatterns. Is this right?
* What is the difference between Customizer Folders and Specialists? When is
the best time to use each?
* It is my understanding that if I use ZPatterns I can create an unlimited
amount of objects and as long as they are stored in a SQL database then the
ZODB will stay the same size. Is this correct?
* How do I use the option in storage "Object are loaded by accessing
attribute ___"?

Thanks for any help!
-Ben


BEGIN:VCARD
VERSION:2.1
N:Schochet;Ben
FN:Ben Schochet
ORG:KillerSite.com
TITLE:Director, Interactive Development
NOTE;ENCODING=QUOTED-PRINTABLE:KillerSite.com provides custom software development solutions, software for =
the web and PCs on time, on target, and on budget. Let us impress you!=0D=
=0A=0D=0A
TEL;WORK;VOICE:(516) 850-3459
ADR;WORK:;;559 Saddle Ridge Rd.;Woodmere;NY;11598;United States of America
LABEL;WORK;ENCODING=QUOTED-PRINTABLE:559 Saddle Ridge Rd.=0D=0AWoodmere, NY 11598=0D=0AUnited States of America
URL:
URL:http://www.killersite.com
EMAIL;PREF;INTERNET:[EMAIL PROTECTED]
REV:20001116T180129Z
END:VCARD