newbie question: to edit/delete in zodb
Hi I am a newbie to zope. I need a sample code to perform, editing/deleting properties of zodb object I use the following code to add a file to a folder as well as properties of that. ////////////// entries_folder.manage_addProduct['OFSP'].manage_addFile(id, title="", content_type="text/plain", file=comments) # add a required properties entry=getattr(entries_folder, id) entry.manage_addProperty('name', name, 'string') //////////////// Thanks in advance, -visu --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software
entry.manage_delProperties(['your_property']) entry.manage_changeProperties(your_property='new value') cheers, Chris Vinoth wrote:
Hi I am a newbie to zope. I need a sample code to perform, editing/deleting properties of zodb object I use the following code to add a file to a folder as well as properties of that. ////////////// entries_folder.manage_addProduct['OFSP'].manage_addFile(id, title="", content_type="text/plain", file=comments) # add a required properties entry=getattr(entries_folder, id) entry.manage_addProperty('name', name, 'string') //////////////// Thanks in advance, -visu
------------------------------------------------------------------------ Do you Yahoo!? Yahoo! SiteBuilder <http://us.rd.yahoo.com/evt=10469/*http://sitebuilder.yahoo.com> - Free, easy-to-use web site design software
------------------------------------------------------------------------
_______________________________________________ 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 )
I am a newbie to zope. I need a sample code to perform, editing/deleting properties of zodb object I use the following code to add a file to a folder as well as properties of that. ////////////// entries_folder.manage_addProduct['OFSP'].manage_addFile(id, title="", content_type="text/plain", file=comments) # add a required properties entry=getattr(entries_folder, id) entry.manage_addProperty('name', name, 'string') ////////////////
manage_changeProperties() manage_delProperties() http://zope.org/Documentation/Books/ZopeBook/2_6Edition/AppendixB.stx http://cvs.zope.org/Zope/lib/python/OFS/PropertyManager.py?rev=HEAD&content-... http://www.zopelabs.com/cookbook/995012093 Note that the documentation in the Zope Book is incomplete about PropertyManager. It does in fact provide many of the same method signatures as PropertySheet. --jcc -- "Code generators follow the 80/20 rule. They solve most of the problems, but not all of the problems. There are always features and edge cases that will need hand-coding. Even if code generation could build 100 percent of the application, there will still be an endless supply of boring meetings about feature design." (http://www.devx.com/java/editorial/15511)
participants (3)
-
Chris Withers -
J Cameron Cooper -
Vinoth