----- Original Message ----- From: "Andy McKay" <AndyM@ActiveState.com> To: "Daniel Rusch" <drusch@globalcrossing.com> Sent: Thursday, August 17, 2000 11:21 AM Subject: Re: [Zope] Product inhetitance question
Ah... ok sorry you are right, stuff outside the class doesnt get inherited. What I did for this was make a very generic manage_addProduct and specify in my _init_.py a class initialisation string or whatever it is called...
context.registerClass(A.ObjB, permission='Add ObjB', constructors=(A.addForm, A.manage_addA) )
If that makes sense. The manage_AddObject form creates an the right object depending upon paramaters passed to it.
-- Andy McKay, Developer, ActiveState http://www.ActiveState.com Programming for the People
----- Original Message ----- From: "Daniel Rusch" <drusch@globalcrossing.com> To: "Andy McKay" <AndyM@ActiveState.com> Sent: Thursday, August 17, 2000 9:10 AM Subject: Re: [Zope] Product inhetitance question
Slightly,
I understand that if A has foo() then so does B(). But in a Zope product the are some things that lie "outside" of the class definition. The manage_add function is one of them. addtionally, I am having troubles getting B to inherit A's _properties structure.
Thanks for all your help. I have learned an unbelieveable amount this week. Everyone else is gone and we are in a slow period so I wanted to learn the more advanced techniques this week.
Dan
Andy McKay wrote:
Well by inheritance B has all the methods, properties etc you have in A. So the answer is yes, if A has the foobar method then B will have a foobar method.
Or do I misunderstand your question? -- Andy McKay, Developer, ActiveState http://www.ActiveState.com Programming for the People
----- Original Message ----- From: "Daniel Rusch" <drusch@globalcrossing.com> To: <zope@zope.org> Sent: Thursday, August 17, 2000 8:42 AM Subject: [Zope] Product inhetitance question
Hey all,
Say I have a fully functional (and more importantly, working) Product will call A.
I want to extend this Product's capabilities so I wish to derive another class from it, call it B.
No problem,
class B(A): .........
The question is, (I think the answer is no) is there a way to inherit (i.e. reuse common code and extend it) the manage_Add function and the dtml files from A???
Thanks,
DR
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )