[Zope-CMF] How do you add an action in python code?

2010-06-18 Thread Suresh V.
I have been looking at the Action* related code and have not been able 
to figure it out completely.

I tried portal_actions.addAction(...) but this adds it under the 
Actions tab with the big RED deprecation warning.

I am able to add it from the ZMI correctly, but can't trace the code 
that does the real adding (Ended up getting lost in GenericSetup browser 
views).

Can someone give me a pointer?

Suresh

___
Zope-CMF maillist  -  Zope-CMF@zope.org
https://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests


Re: [Zope-CMF] How do you add an action in python code?

2010-06-18 Thread yuppie
Suresh V. wrote:
 I have been looking at the Action* related code and have not been able
 to figure it out completely.

 I tried portal_actions.addAction(...) but this adds it under the
 Actions tab with the big RED deprecation warning.

 I am able to add it from the ZMI correctly, but can't trace the code
 that does the real adding (Ended up getting lost in GenericSetup browser
 views).

 Can someone give me a pointer?

There is no special API. ActionCategory inherits from OFS.OrderedFolder, 
you can use the _setObject method.

HTH, Yuppie
___
Zope-CMF maillist  -  Zope-CMF@zope.org
https://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests