Re: [Zope] saving/creating an object to an exsisting folderish object
'name' is a string obj I have a exsisting folder name == folder.getId() say I want to use manage_addFile('point', 'a point') into this folder with the getId() == name but I can't do name.manage_addFile('point', 'a point') because 'name' is a str object so how do I create a file inside a folder whose id is 'name'? - Original Message From: Andreas Jung [EMAIL PROTECTED] To: Allen Huang [EMAIL PROTECTED]; Zope zope@zope.org Sent: Sunday, January 7, 2007 3:39:39 PM Subject: Re: [Zope] saving/creating an object to an exsisting folderish object --On 6. Januar 2007 21:28:06 -0800 Allen Huang [EMAIL PROTECTED] wrote: is there a method that uses 'name'(a str object) as an argument to call upon this folder? to call upon this folder? No idea what you mean. -aj __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] saving/creating an object to an exsisting folderish object
--On 7. Januar 2007 00:02:21 -0800 Allen Huang [EMAIL PROTECTED] wrote: 'name' is a string obj I have a exsisting folder name == folder.getId() say I want to use manage_addFile('point', 'a point') into this folder with the getId() == name but I can't do name.manage_addFile('point', 'a point') because 'name' is a str object so how do I create a file inside a folder whose id is 'name'? here is a german FAQ: http://www.zope.de/dokumentation/faqs/entwicklung/PythonScripts/add_product/?searchterm=manage_add* Google for manage_addProduct() or search on zope.org -aj pgpsghR4tdF60.pgp Description: PGP signature ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] saving/creating an object to an exsisting folderish object
I don't have a problem with manage_addProduct(). I know how it works. Creating objects in a folder is not a problem to me. My problem is the folderish object which I'm trying to find with a string input. If you've read my previous message, the server output error with name.manage_addFile('point', 'a point') because name is a str object and does not have manage_addFile. I understand this. But name is an id to an exsisting folder that I want to access and do operation inside. how would I modify name.manage_addFile('point', 'a point') into a working statement? - Original Message From: Andreas Jung [EMAIL PROTECTED] To: Allen Huang [EMAIL PROTECTED]; Zope zope@zope.org Sent: Sunday, January 7, 2007 4:06:27 PM Subject: Re: [Zope] saving/creating an object to an exsisting folderish object --On 7. Januar 2007 00:02:21 -0800 Allen Huang [EMAIL PROTECTED] wrote: 'name' is a string obj I have a exsisting folder name == folder.getId() say I want to use manage_addFile('point', 'a point') into this folder with the getId() == name but I can't do name.manage_addFile('point', 'a point') because 'name' is a str object so how do I create a file inside a folder whose id is 'name'? here is a german FAQ: http://www.zope.de/dokumentation/faqs/entwicklung/PythonScripts/add_product/?searchterm=manage_add* Google for manage_addProduct() or search on zope.org -aj __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] saving/creating an object to an exsisting folderish object
I found the solution... use _.getitem(name) this took some book flipping through some basic methods of zope modules in 'The Book of ZOPE' by Beehive. A pretty good book for beginners - Original Message From: Allen Huang [EMAIL PROTECTED] To: zope@zope.org Sent: Sunday, January 7, 2007 5:00:03 PM Subject: Re: [Zope] saving/creating an object to an exsisting folderish object I don't have a problem with manage_addProduct(). I know how it works. Creating objects in a folder is not a problem to me. My problem is the folderish object which I'm trying to find with a string input. If you've read my previous message, the server output error with name.manage_addFile('point', 'a point') because name is a str object and does not have manage_addFile. I understand this. But name is an id to an exsisting folder that I want to access and do operation inside. how would I modify name.manage_addFile('point', 'a point') into a working statement? - Original Message From: Andreas Jung [EMAIL PROTECTED] To: Allen Huang [EMAIL PROTECTED]; Zope zope@zope.org Sent: Sunday, January 7, 2007 4:06:27 PM Subject: Re: [Zope] saving/creating an object to an exsisting folderish object --On 7. Januar 2007 00:02:21 -0800 Allen Huang [EMAIL PROTECTED] wrote: 'name' is a string obj I have a exsisting folder name == folder.getId() say I want to use manage_addFile('point', 'a point') into this folder with the getId() == name but I can't do name.manage_addFile('point', 'a point') because 'name' is a str object so how do I create a file inside a folder whose id is 'name'? here is a german FAQ: http://www.zope.de/dokumentation/faqs/entwicklung/PythonScripts/add_product/?searchterm=manage_add* Google for manage_addProduct() or search on zope.org -aj __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev ) __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] saving/creating an object to an exsisting folderish object
--On 7. Januar 2007 08:07:28 -0800 Allen Huang [EMAIL PROTECTED] wrote: I found the solution... use _.getitem(name) this took some book flipping through some basic methods of zope modules in 'The Book of ZOPE' by Beehive. A pretty good book for beginners Why (the hell) are you (still) using DTML (as newbie). You are strongly encouraged to use ZPT. -aj pgpN5Lj6da8Ze.pgp Description: PGP signature ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] saving/creating an object to an exsisting folderish object
Will... I just found out that I'm suppose to migrate to ZPT. But, I start with DTML to begin with and I've be doing it for the past two years, so it's kind hard for me to move on to xml and ZPT right off the bat. But the tag:attribute structure still confuses me. Anyways, thanks for all your help Andreas, couldn't done it without you forcing me to think about my problem. - Original Message From: Andreas Jung [EMAIL PROTECTED] To: Allen Huang [EMAIL PROTECTED]; Zope zope@zope.org Sent: Monday, January 8, 2007 4:39:32 AM Subject: Re: [Zope] saving/creating an object to an exsisting folderish object --On 7. Januar 2007 08:07:28 -0800 Allen Huang [EMAIL PROTECTED] wrote: I found the solution... use _.getitem(name) this took some book flipping through some basic methods of zope modules in 'The Book of ZOPE' by Beehive. A pretty good book for beginners Why (the hell) are you (still) using DTML (as newbie). You are strongly encouraged to use ZPT. -aj __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] saving/creating an object to an exsisting folderish object
Aloha, Allen Huang wrote: Will... I just found out that I'm suppose to migrate to ZPT. But, I start with DTML to begin with and I've be doing it for the past two years, so it's kind hard for me to move on to xml and ZPT right off the bat. But the tag:attribute structure still confuses me. I started using zope right about when TAL/ZPT was fully rolled out (2.4.x or so)...to me the dtml structure is confusing as heck to look at...it's all relative... :-) Go for it, make the switch, eventually you'll be really glad you did. Not the least because almost nobody is going to help you with dtml any more...! TAL is not easy reading for me either but it sure beats the alternatives. I am easily disappointed by other web dev platforms that despite all kinds of other sophistication (ruby-rails, alfresco etc.) still keep using or creating yet one more HTML-munging template language. I mean, how 20th century is that? cheers, John S. -- John Schinnerer - MA, Whole Systems Design -- - Eco-Living - Whole Systems Design Services People - Place - Learning - Integration [EMAIL PROTECTED] http://eco-living.net ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
[Zope] saving/creating an object to an exsisting folderish object
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 this is very ineffecient when you have a lot of data. Is there a ways I could do something like getFolder( name ).doSomething(). Is there anything like that in dtml? __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] saving/creating an object to an exsisting folderish object
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 [EMAIL PROTECTED] To: Allen Huang [EMAIL PROTECTED]; Zope zope@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 [EMAIL PROTECTED] 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 ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] saving/creating an object to an exsisting folderish object
--On 6. Januar 2007 21:28:06 -0800 Allen Huang [EMAIL PROTECTED] wrote: is there a method that uses 'name'(a str object) as an argument to call upon this folder? to call upon this folder? No idea what you mean. -aj pgpJwNBgoYMPw.pgp Description: PGP signature ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )