hello, I wish to know if there is another way than self.manage_addProduct['OFSP'].manage_addNiceProduct(id) to add a product to an object which inherits from ObjectManager ? My problem is that I would like to create the object first and add it latter to the object manager. Idea ? TIA -- Sylvain Thénault
Sylvain Thénault wrote:
I wish to know if there is another way than
self.manage_addProduct['OFSP'].manage_addNiceProduct(id)
to add a product to an object which inherits from ObjectManager ? My problem is that I would like to create the object first and add it latter to the object manager. Idea ?
If it is a Python based product you can just import the product in the normal fashion and then instanciate it. Ie. from an external script. from NiceProduct import NiceProduct id = 'niceId' niceProduct = NiceProduct(id) niceProduct.title = 'Nice Title' self.someFolder._setObject(id, theClass(niceProduct)) regards Max M
Max M wrote:
If it is a Python based product you can just import the product in the normal fashion and then instanciate it. Ie. from an external script.
from NiceProduct import NiceProduct
id = 'niceId' niceProduct = NiceProduct(id) niceProduct.title = 'Nice Title' self.someFolder._setObject(id, theClass(niceProduct))
Whoops ... wrong code in the last line:: self.someFolder._setObject(id, niceProduct) regards Max M "Sorry I would Really Like To Help More On This Project, But Am To Busy Doing Paid Work On A Tight Deadline" Max M
participants (2)
-
Max M -
Sylvain Thénault