Creating a LocalContent object from a Python script
Hi! I need to create a LocalContent object from within a Python script, and I don't know how to do it. I think the function to be called is manage_addLocalContent, and I try it as if I were adding a file (context.manage_addLocalContent(id, title, languages)) but it says the function does not exist. Any ideas? Igor Leturia
I need to create a LocalContent object from within a Python script, and I don't know how to do it. I think the function to be called is manage_addLocalContent, and I try it as if I were adding a file (context.manage_addLocalContent(id, title, languages)) but it says the function does not exist.
Take a look through the source to make sure of the function name and parameters. Located under lib/python/Products/ Also make sure that 'context' is an ObjectManager, or it won't work. --jcc
Igor Leturia wrote at 2003-3-11 17:54 +0100:
I need to create a LocalContent object from within a Python script, and I don't know how to do it. I think the function to be called is manage_addLocalContent, and I try it as if I were adding a file (context.manage_addLocalContent(id, title, languages)) but it says the function does not exist.
I do not know what a "LocalContent" object is but usually you use: destination.manage_addProduct[product_name].constructor(args) where "destination" is the destination ObjectManager where the new object shoult be placed into, "productname" is the name of the product that defines the objects class, "constructor" is the constructor for this kind of objects and "args" are the constructor arguments. Dieter
participants (3)
-
Dieter Maurer -
Igor Leturia -
J Cameron Cooper