[Zope-CMF] Programmatically manipulating actions on a TypeInfo object

David Harvey (Hamish) david.harvey@bristol.ac.uk
29 May 2002 20:28:16 +0100


I'm trying to programmatically set the action field of an action in a
TypeInformation object (in an external method). I've tried a few tacks
on this and can't work it out. In particular, if I try to get hold of
the action from a TypeInformation object and assign to the _action
field:

    view_action = typeObj.getActionById('view')
    view_action._action = "links_view"

I get an error (object has read-only attributes) and the following
trace:

File D:\FLOODR~1\Zope\lib\python\Products\ExternalMethod\ExternalMethod.py, line 205, in __call__
    (Object: install_floodrisknet)
    (Info: ((), {}, None))
  File D:\FLOODR~1\Zope\lib\python\Products\FloodRiskNet\Extensions\Install.py, line 545, in install
    (Object: floodrisknet)
  File D:\FLOODR~1\Zope\lib\python\Products\FloodRiskNet\Extensions\Install.py, line 210, in addContentTypes
    (Object: floodrisknet)
TypeError: (see above)

Any  ideas how to go about this?

Cheers,
Hamish

-- 
David Harvey (aka Hamish)
Network Coordinator, FloodRiskNet
Research Assistant, Water and Environmental Management Research Centre
University of Bristol, Lunsford House, Cantock's Close, Bristol BS5 6BU
Tel: +44 (117) 9289768 Fax: +44 (117) 9289770
Email: david.harvey@bristol.ac.uk
GPG/PGP Key Fingerprint: 6F15 A1C7 342F 2F87 E2CC  176D 1072 8A5B 20E8
E497
WWW: http://www.cen.bris.ac.uk/civil/pgra/dph/dph.htm