[Zope] Debugging Zope Products
Dieter Maurer
dieter@handshake.de
Mon, 10 Mar 2003 22:10:33 +0100
Derek Basch wrote at 2003-3-9 11:12 -0800:
> ....
> There is this paragraph:
>
> "So, for the sake our example, let's say that you have
> a News object which is defined in a Zope Product
> called ZopeNews, and is located in the
> lib/python/Products/ZopeNews directory. The class that
> defines the News instance is also called News, and is
> defined in the News.py module in your product."
>
> I do not understand what the author means by "News
> object"?
He probably used sloppy terminology:
Think you want to manage "News" objects in your site.
You define a class for them (such that they become instances
of this class). You call them "News" (what else).
Such classes usually live in a product. A product
is represented as a subfolder of the (a, when you
are using INSTANCE_HOME or other magic environment variables)
"Products" folder. You put your "News" class into
a product called "ZopeNews".
Nothing happened up to now: you got only a description
of the setup: "News" objects which are instances of
the "News" class which is defined in the "ZopeNews" product...
> What exactly is a News object and how was it
> defined? Is it a class that was registered with the
> registrar object during product initialization?
Yes.
> What would really help me is a tutorial using a real
> Zope product rather than a fake one like in the
> Developers Guide. Can anyone clear my confusion?
You have Zope installed?
Look at its "Products" folder. You find several dozens
of real life examples ;-)
Use a modern product, e.g. PageTemplates, to learn how to
do product definition and registration. Old
products do it differently and in an less obvious way.
Read the ZDG in parallel that you understand what you see...
Dieter