[Zope] How to make a Python Product Class a BaseClass for ZClasses
Stephan Richter
srichter@cbu.edu
Wed, 3 Nov 1999 08:12:58 -0600
I got it working last night. The product won't work id you misspell the
addClass method in you module. No error messages. Found it by mistake.
stephan
On Wed, 03 Nov 1999, Martijn Faassen wrote:
> Stephan Richter wrote:
> >
> > hello everyone,
> >
> > how can I make a python product ZClass like ZPickle and so on a BaseClass for
> > ZClasses.
> >
> > I know I have to write context.registerBaseClass(ZPickle.ZPickle). But that
> > alone will not do it. Can someone help me, please?
>
> Hm, but that works for me. I just do in __init__.py:
>
> import foo
>
> def initialize(context):
> context.registerBaseClass(foo.MyClass)
>
> Are you sure your __init__.py works? I've noticed a lack of Zope error
> messages when you make a typo in __init__.py, or refer to nonexisting
> classes etc.
>
> After that, you restart your Zope, and then you should be able to use
> the base class when you create a ZClass. Note that I've always inherited
> from simple Python classes instead of full fledged Zope products.
> Anthony Pfrunder has experience doing the latter I believe, so you may
> want to ask him.
>
> Regards,
>
> Martijn
>
> _______________________________________________
> Zope maillist - Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
>
> (Related lists - please, no cross posts or HTML encoding!
>
> To receive general Zope announcements, see:
> http://lists.zope.org/mailman/listinfo/zope-announce
>
> For developer-specific issues, zope-dev@zope.org -
> http://lists.zope.org/mailman/listinfo/zope-dev )
--
--
Stephan Richter
iXL - Software Designer and Engineer
CBU - Physics, Computer Science and Chemistry Student