[Zope] saving/creating an object to an exsisting folderish object

Allen Huang swapp0 at yahoo.com
Sun Jan 7 00:28:06 EST 2007


dear Andreas

make my question short.
I have a string object 'name' and it is a name of an exsiting folder
is there a method that uses 'name'(a str object) as an argument to call upon this folder? 



----- Original Message ----
From: Andreas Jung <lists at zopyx.com>
To: Allen Huang <swapp0 at yahoo.com>; Zope <zope at zope.org>
Sent: Saturday, January 6, 2007 10:20:16 PM
Subject: Re: [Zope] saving/creating an object to an exsisting folderish object


--On 6. Januar 2007 06:17:40 -0800 Allen Huang <swapp0 at yahoo.com> wrote:

> This is a problem a got a lot and I never able to seem to solve it.
> I want save or create a object to a specific folder or other folderish
> object,          I ask the user for the id of that folder or folderish
> object                 I store the id name in a variable 'name'
>
> the problem is I know the type of the folder or folderish object but
> 'name' is a str object and I can't use command like name.manage_addFile().
> The server just tells me that name is a str which contains no function
> manage_addFile().
>
> I always end up doing a
> <dtml-in "objectValues(['Folder'])">
>     <dtml-if "getId() == name">
>         do something....
>     </dtml-if>
> </dtml-in>
>
>

Please take the advice and learn Python. Such logic should be implemented
in Python and *not* in DTML. DTML/ZPT are for presentation *only*, not for
implementing business logic.

-aj

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.zope.org/pipermail/zope/attachments/20070106/844429d6/attachment.htm


More information about the Zope mailing list