How to create zope objects without using the ZMI?
Is there another way to create zope object? Is it possible to write a python script to create object, say a file or a page template? If the answer is yes, how? Thanks in advance. Michael _________________________________________________________________ Don't just search. Find. Check out the new MSN Search! http://search.msn.click-url.com/go/onm00200636ave/direct/01/
Michael Lee wrote:
Is there another way to create zope object? Is it possible to write a python script to create object, say a file or a page template? If the answer is yes, how?
Thanks in advance.
Michael
_________________________________________________________________ Don't just search. Find. Check out the new MSN Search! http://search.msn.click-url.com/go/onm00200636ave/direct/01/
_______________________________________________ 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 )
thats what scripts are for. Giving you an answer to how this is done means writing a manual. Since this alredy exists why do you not just read it? http://zope.org/Documentation/Books/ZopeBook/2_6Edition robert
robert wrote:
Michael Lee wrote:
Is there another way to create zope object? Is it possible to write a python script to create object, say a file or a page template? If the answer is yes, how?
Thanks in advance. Michael
Hi Michael, What you should look at in the manual is Appendix :: module ObjectManager: It states that: """ An ObjectManager contains other Zope objects. The contained objects are Object Manager Items. To create an object inside an object manager use manage_addProduct: self.manage_addProduct['OFSP'].manage_addFolder(id, title) [My Note] In a PythonScript you can use: context.manage_addProduct['OFSP'].manage_addFolder(id, title) [/My Note] In DTML this would be: <dtml-call "manage_addProduct['OFSP'].manage_addFolder(id, title)"> These examples create a new Folder inside the current ObjectManager. manage_addProduct is a mapping that provides access to product constructor methods. It is indexed by product id. Constructor methods are registered during product initialization and should be documented in the API docs for each addable object. [My Note] E.g. 'OFSP', manage_addFolder, and the arguments to manage_addFolder will be different for diffrent objects. OFSP is the Products for regular Zope objects (Image, File, Folder ( Ordered Folder), DTML Method etc). [/My Note] """ -- Johan Carlsson Tel: + 46 8 31 24 94 Colliberty Mob: + 46 70 558 25 24 Torsgatan 72 Email: johanc@easypublisher.com SE-113 37 STOCKHOLM
Thanks a lot guys. I am very much amazed when I see your responses as I am just a new comer to zope and I did not expect to get such instant and helpful answers :) I should have read the API carefully before posting the question but it was just a bit too advanced when I first looked at it. Anyway, now I have known the trick and my sailing with zope can proceed. There will be more mysteries ahead but with your kind support, nothing would hold me back. Set Sail ...! :D Johan wrote:
robert wrote:
Michael Lee wrote:
Is there another way to create zope object? Is it possible to write a python script to create object, say a file or a page template? If the answer is yes, how?
Thanks in advance. Michael
_________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
participants (3)
-
Johan Carlsson -
Michael Lee -
robert