In my python product I have a class (IssueFollowup), which I don't want to register using registerClass because I want instances to be added only through instances of another class (Issue). I have the necessary code in class Issue that creates and adds objects of class IssueFollowup to the folder in context. 1. Is this ok ? (Seems to work but are there any possible pitfalls) 2. IssueFollowup objects appear in the Contents tab but without any icons. How can I register an icon without having IssueFollowup pollute the drop down list ? Thanks, Shalabh
There was a thread on this here about 2 weeks ago titled "object icons". There is a "deprecated" way of doing it, but the thread got off track without a real answer (the "right" way). The "deprecated" (the old-fashioned) way is documented in the old Product API and is used by ZScheduler. It works like this: In __init__.py module: # use the old method to set the icon for the ZSchedule object misc_ = { 'ZScheduleIcon': ImageFile('www/ZSchedule.gif', globals()) } In class definition. class ZSchedule(ZCatalog.ZCatalog): """ An event Schedule. This is also a container. """ meta_type = 'ZSchedule' icon='misc_/ZScheduler/ZScheduleIcon' -- HTH -- Loren ----- Original Message ----- From: Shalabh Chaturvedi <shalabh@pspl.co.in> To: zope <Zope@zope.org> Sent: March 06, 2000 05:25 AM Subject: [Zope] Registering just an icon not constructor
In my python product I have a class (IssueFollowup), which I don't want to register using registerClass because I want instances to be added only through instances of another class (Issue).
I have the necessary code in class Issue that creates and adds objects of class IssueFollowup to the folder in context.
1. Is this ok ? (Seems to work but are there any possible pitfalls)
2. IssueFollowup objects appear in the Contents tab but without any icons. How can I register an icon without having IssueFollowup pollute the drop down list ?
Thanks, Shalabh
From: "Shalabh Chaturvedi" <shalabh@pspl.co.in>
In my python product I have a class (IssueFollowup), which I don't want to register using registerClass because I want instances to be added only through instances of another class (Issue).
I have the necessary code in class Issue that creates and adds objects of class IssueFollowup to the folder in context.
1. Is this ok ? (Seems to work but are there any possible pitfalls)
Sounds fine to me.
2. IssueFollowup objects appear in the Contents tab but without any icons. How can I register an icon without having IssueFollowup pollute the drop down list ?
Have a look at a recent discussion about this on zope@zope.org: http://lists.zope.org/pipermail/zope/2000-February/subject.html#19408 Martijn Pieters | Software Engineer mailto:mj@digicool.com | Digital Creations http://www.digicool.com/ | Creators of Zope http://www.zope.org/ | The Open Source Web Application Server ---------------------------------------------
participants (3)
-
Loren Stafford -
Martijn Pieters -
Shalabh Chaturvedi