RE: [Zope] better than Notes (but where are the views ?)
thanks Rob and Kevin, having a ball and lots of success mixing zcatalog with zclasses... Kevin Dangoor wrote :
however, i'm missing sommething. i can create these documents (oops, i mean zclass instances) but how do i get them out of the object db again ? is it possible to create the equivalent of Notes 'views' ? ie. filter all the instances of a class and/or with certain values of given properties ?
This is what ZCatalog comes in. It makes it really easy to grab objects from all over the ZODB and spit them out any way you want.
<dtml-in "Catalog({'meta_type': 'Article', 'author': 'Blah'})"> <dtml-if sequence-start> <ul> </dtml-if> <li><dtml-var title></li> <dtml-if sequence-end> </ul> </dtml-if> </dtml-in>
This is how the new zope.org beta works. A user can create a news item in their own Member folder and, after approval, this article will bubble up to the main news listing via ZCatalog.
--------------------------------------------- Rob Page wrote :
eg. just say i had a zclass called "articles" and each article has an "author" and a "date". i then create 100 instances of this zclass. how could i display all the articles written by a given author or on a certain date ?
You could either:
(a) tool through all of them searching for the values you were after (yuck), or (b) use the ZCatalog stuff
ZCatalog is a full-text and fielded indexing engine for Zope. The New Zope Site uses ZClasses and the ZCatalog EXTENSIVELY.
IMO, ZClass instances + ZCatalog are analagous to Notes views.
even more powerful, now that i've played with them - a little more work in the short term, but paying off handsomely already. just need to free up time/bandwidth to try mixing this with the Python notes classes and things'll get really interesting ;-) cheers, chas ps. even had a lotus consultant (anonymity requested) write "looks like domino done right" :-)
participants (1)
-
chas