Hello all, Background ---------- I am building an Image Archive Zope application using ZPatterns. I originally was trying to convert the Photo Product to ZPatterns in such a way as to still have it work as a normal product, but that turned out to be too complex. So, I am building the application fresh. So far, I have a RackImage Python product that subclasses from Image and DataSkin which seems to work fine. I can create, upload, view and delete the RackImages. Now I am working on a ArchiveImage ZClass that holds 'meta' information about an image, such as the description, a date, and keywords. I want to have one Rack for each image size that I want to store. I realize that I need to tie the Racks together in the specialist using SkinScripts, but I had a question that is a bit more fundamental: Where do I put the separate Racks? do I create a specialist for each Rack (seems unneccessary) or do I put several Racks in the same Specialist? If the latter, I'm unsure how to use DTML or PythonScripts to specify which Rack to create a new item in. The DTML I am using to instantiate RackImages in the Rack for example, is as follows: <dtml-let ni="newItem(REQUEST.id)"> <dtml-call "ni.manage_edit(REQUEST.title,'')"> <dtml-call "ni.manage_upload(REQUEST.file)"> </dtml-let> But this code only works for a Rack named defaultRack, which I can obviously only have one of. Any advice on this would be greatly appreciated. Thanks, Michael Bernstein.
At 05:27 PM 3/30/01 -0800, Michael R. Bernstein wrote:
Now I am working on a ArchiveImage ZClass that holds 'meta' information about an image, such as the description, a date, and keywords.
I want to have one Rack for each image size that I want to store.
Just out of curiousity, why do you want seperate racks for each size? Are they being stored in different ways or have different behavioral requirements (e.g. different classes) apart from their size? If not, there is probably no reason to have multiple racks.
I realize that I need to tie the Racks together in the specialist using SkinScripts
SkinScript doesn't do anything to tie racks together or to a Specialist - it's just a way of describing where the data comes from/goes to for a particular Rack.
Where do I put the separate Racks? do I create a specialist for each Rack (seems unneccessary) or do I put several Racks in the same Specialist?
Several in the same, if they are providing objects which fill the same role in your overall application.
If the latter, I'm unsure how to use DTML or PythonScripts to specify which Rack to create a new item in.
The DTML I am using to instantiate RackImages in the Rack for example, is as follows:
<dtml-let ni="newItem(REQUEST.id)"> <dtml-call "ni.manage_edit(REQUEST.title,'')"> <dtml-call "ni.manage_upload(REQUEST.file)"> </dtml-let>
But this code only works for a Rack named defaultRack, which I can obviously only have one of.
Any advice on this would be greatly appreciated.
Just use the name of the rack, e.g.: <dtml-let ni="rackOne.newItem(REQUEST.id)">, etc. Racks are subobjects of their specialists.
participants (2)
-
Michael R. Bernstein -
Phillip J. Eby