[Zope-CMF] Create new portal property with a Python script
hans at mmmanager.org
Tue Feb 14 05:59:30 EST 2006
Andreas Jung wrote:
> --On 14. Februar 2006 10:20:24 +0100 Hans Schou <hans at mmmanager.org>
>> A very new into Zope/CMF/Plone so it might be a silly question I have.
>> I have installed PloneMall. In that there is a tool which is called
>> portal_ordermanager. If I open that I can go to the Properties tab, and
>> in that I can add a new property which is of the type "lines" and
>> one of the type "selection".
> Look at the PropertyManager API (as documented in the Zope Book 2.7
> Appendix A or B), manage_addProperty()...or grep through existing
> source...there are enough code examples.
Thanks for the quick answer. It helped me a lot.
I got one little problem left. How do I assign a variable of the type
"selection" the value of index 0 in the list?
I get the error: attribute-less object (assign or del)
As I understand, pom.Ewire should be of the type string.
pom = getToolByName(context, 'portal_ordermanager', None)
pom.Ewire = pom.EwireIDURL # I get an error here on this line
print pom.Ewire # when the variable is set, this line works fine
More information about the Zope-CMF