[Zope-dev] ZPatterns Project Help!

Phillip J. Eby pje@telecommunity.com
Sun, 19 Nov 2000 17:56:11 -0500


At 10:40 PM 11/18/00 -0500, Ben Schochet wrote:
>
>* It seems that I need to have separate Racks for each Class that I want to
>store with ZPatterns. Is this right?

Yes.

>* What is the difference between Customizer Folders and Specialists? When is
>the best time to use each?

Customizer Folders are for when your application stores data Zope-style, in
an object/folderish hierarchy.  Specialists are for creating application
services.  They are not necessarily mutually exclusive, since an
application with an object hierarchy may still use a Specialist to handle
searching, creating objects, UI snippets, and so forth.

>* 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?

Yes.  As long as you don't have any persistent data stored for the object,
and as long as your application doesn't change anything else in the ZODB.


>* How do I use the option in storage "Object are loaded by accessing
>attribute ___"?

Set it to the name of an object attribute that is provided from your SQL
data.  When the rack is asked to retrieve an object, it creates an empty
object with an "id" attribute, then tries to access the attribute specified
in this storage option.  If the attribute exists (i.e., the row exists and
is successfully retrieved from your SQL database), then the object will be
returned from the Rack.  If the attribute does not exist (due to the query
failing), the Rack will return None to mean that the object does not exist.