Hi, being the use of ZClasses frequently discouraged, I was wondering if there is any way to dynamically add or reindex objects in a ZCatalog or if there is any alternative. thanks massimo
massimop@users.berlios.de wrote at 2004-10-9 18:30 +0200:
being the use of ZClasses frequently discouraged, I was wondering if there is any way to dynamically add or reindex objects in a ZCatalog or if there is any alternative.
You can dynamically add and reindex objects in a ZCatalog. Look at the methods "ZCatalog" provides (almost surely, the methods are described in the Zope Book (2.6/2.7 edition, online) as well). -- Dieter
On Sun, 2004-10-10 at 23:02 +0200, Dieter Maurer wrote:
massimop@users.berlios.de wrote at 2004-10-9 18:30 +0200:
being the use of ZClasses frequently discouraged, I was wondering if there is any way to dynamically add or reindex objects in a ZCatalog or if there is any alternative.
You can dynamically add and reindex objects in a ZCatalog.
Look at the methods "ZCatalog" provides (almost surely, the methods are described in the Zope Book (2.6/2.7 edition, online) as well).
thanks for the answer the chapter 'Searching and Categorizing Content' of the ZopeBook seems to rely on ZClasses, but you made me recall of the API Reference in Appendix, in which there's a method called 'catalog_object' the name is promising, but I can't find any documentation yet I'll do a bit of guessing thanks massimo
massimop@users.berlios.de wrote:
On Sun, 2004-10-10 at 23:02 +0200, Dieter Maurer wrote:
massimop@users.berlios.de wrote at 2004-10-9 18:30 +0200:
being the use of ZClasses frequently discouraged, I was wondering if there is any way to dynamically add or reindex objects in a ZCatalog or if there is any alternative.
You can dynamically add and reindex objects in a ZCatalog.
Look at the methods "ZCatalog" provides (almost surely, the methods are described in the Zope Book (2.6/2.7 edition, online) as well).
thanks for the answer
the chapter 'Searching and Categorizing Content' of the ZopeBook seems to rely on ZClasses, but you made me recall of the API Reference in Appendix, in which there's a method called 'catalog_object'
Well, there is an even simplest way : having your Product's class(es) implementing ZCatalog.CatalogPathAwareness.CatalogPathAware. If you need to redefine the manage_afterAdd() and manage_beforeDelete() methods, don't forget to first call inheritedAttribute(...) before. Else it should do the stuff right out of the box. HTH Bruno -- Bruno Desthuilliers - Analyste-programmeur bruno@modulix.org www.modulix.com
Hi I was asking a similar question this morning on the ZODB-Dev list: How can I use ZCatalog indexing an searching on a ZODB for a Python app without Zope? I have used it with a file-system based product with Zope, but now I need the same functionality for a stand-alone application. Maybe somebody here has an idea, too. thanks Andre
Andre Meyer wrote at 2004-10-11 14:13 +0200:
How can I use ZCatalog indexing an searching on a ZODB for a Python app without Zope? I have used it with a file-system based product with Zope, but now I need the same functionality for a stand-alone application.
You can use Zope in a stand alone application... You can use ZCatalog in such applications... -- Dieter
On Mon, 2004-10-11 at 13:39 +0200, bruno modulix wrote: ...
Well, there is an even simplest way : having your Product's class(es) implementing ZCatalog.CatalogPathAwareness.CatalogPathAware.
If you need to redefine the manage_afterAdd() and manage_beforeDelete() methods, don't forget to first call inheritedAttribute(...) before. Else it should do the stuff right out of the box.
HTH Bruno
very appealing (I'll take note...), but I don't feel like I'm ready to build my own product yet, I'm still practicing with Zope thanks massimo
"massimop@users.berlios.de" <massimop@users.berlios.de> writes:
very appealing (I'll take note...), but I don't feel like I'm ready to build my own product yet, I'm still practicing with Zope
Is there good docs which explain how to build zope products without ZClasses? I just finished reading "The Zope Book". Unfortunately, this topic is not covered there. -- \ / vlad@hashbang.de \/lad http://www.hashbang.de
On Mon, 2004-10-11 at 18:22 +0200, Vlad Berditchevskiy wrote:
"massimop@users.berlios.de" <massimop@users.berlios.de> writes:
very appealing (I'll take note...), but I don't feel like I'm ready to build my own product yet, I'm still practicing with Zope
Is there good docs which explain how to build zope products without ZClasses? I just finished reading "The Zope Book". Unfortunately, this topic is not covered there.
the Developer Guide (from Zope.org too) I think...
Vlad Berditchevskiy a écrit :
"massimop@users.berlios.de" <massimop@users.berlios.de> writes:
very appealing (I'll take note...), but I don't feel like I'm ready to build my own product yet, I'm still practicing with Zope
Is there good docs which explain how to build zope products without ZClasses? I just finished reading "The Zope Book". Unfortunately, this topic is not covered there.
Then you can switch to the Zope Developper's Guide, but it may give you the feeling that writing Zope Products is a difficult thing - and it isn't (well, depend on what you're trying to do but...). There are some how-to on zope.org that you may want to read... http://zope.org/Members/maxm/index_html/HowTo/minimal_01/ http://zope.org/Members/maxm/index_html/HowTo/minimal_02/ http://www.zope.org/Members/maxm/HowTo/easyProduct http://www.zope.org/Members/gtk/Boring/HowTo-Boring Reading the source code of some existing products may help. Then going thru the source of Zope itself may help too, the API being somewhat underdocumented. Don't be afraid... I'm a Zope newbie too !-) HTH Bruno -- bruno desthuilliers bruno@modulix.org --
massimop@users.berlios.de wrote at 2004-10-10 23:40 +0200:
... the chapter 'Searching and Categorizing Content' of the ZopeBook seems to rely on ZClasses,
It does not... Of course, in order to index an object under a value, the object must have a attribute (or method) the returns this value. ZClasses come with "PropertySheets" (to define attributes) and methods. Both can be used for indexing (and MetaData determination). Without ZClasses, your options are: * properties * acquired methods (usually PythonScripts) * persistent classes in products with their attributes and methods * Archetypes.
... the name is promising, but I can't find any documentation yet I'll do a bit of guessing
Reread the "Searching" section in the Zope Book. Maybe, you find also useful: <http://www.dieter.handshake.de/pyprojects/zope/book/chap3.html> and <http://www.dieter.handshake.de/pyprojects/zope#ManagableIndex> -- Dieter
participants (6)
-
Andre Meyer -
bruno -
bruno modulix -
Dieter Maurer -
massimop@users.berlios.de -
Vlad Berditchevskiy