[ZPT] Parent property?

Philip Kilner phil at xfr.co.uk
Mon Aug 18 20:55:49 EDT 2003


Hi Clemens,

Clemens Robbenhaar wrote:
>  > 	tal:attributes="value here/FolderIssue"
>  > 
>  > ...to set the value of a hidden form field. However, in production the 
>  > "FolderIssue" is a property of the /parent/ folder - what is the syntax 
>  > to pull the property value from the parent folder?
>  > 
> 
>  a) try to find a better solution than properties to store the information
> 

Interesting - the site has a hierarchy of folders, each folder about a 
medical condition ("Issue"). The function of the form is to allow the 
user to add a book to a table in the RDBMS which relates to that 
condition. The database stuff is all in a sub folder of the "Issue" 
folder, and what I am trying to do is pick up the condition from the 
context in the folder hierarchy. I can see that applying properties is 
quite clumsy (Can't use the folder name as this is "Human Friendly" but 
not always "Zope Friendly"), but can't think of a better way right now...

>  b) if You feel that a) is not very helpful ;) try the following
> 
>     - create a script "getFolderIssueForForm" in the folder where the
>       property is really wanted from with the content:
> 
>       return container.getProperty('FolderIssue')
> 
>     - use tal:attributes="value here/getFolderIssueForForm"
>       (i.e. call the script instead of getting the property)
> 
> 
> Maybe this helps?
> 

It does - Thank You.

I guess the "subtext" of this is keeping application and presentation 
logic separate, but given what we are trying to do, that seems 
paradoxical - the application drives the presentation...and vice 
versa...in this case...

This was all so easy in DTML...<sigh>

-- 

Regards,

PhilK

Email: phil at xfr.co.uk / Voicemail & Facsimile: 07092 070518

"the symbols of the divine show up in our world initially at the trash 
stratum." Philip K Dick

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3403 bytes
Desc: S/MIME Cryptographic Signature
Url : http://lists.zope.org/pipermail/zpt/attachments/20030818/78a36c68/smime.bin


More information about the ZPT mailing list