[Zope3-dev] a simple product

Shane Hathaway shane@zope.com
Mon, 20 Jan 2003 12:06:30 -0500


Steve Alexander wrote:
> 
>> Hmm, this is a complex example of indexing.  What about a simpler use: 
>> I'd like to declare that a catalog tries to adapt all objects to a 
>> certain schema, then indexes the data based on that schema.  Do you 
>> see that as a possibility?
> 
> 
> Perhaps. Do you think that is a common use-case? Can you make the 
> use-case more concrete, with an example?

I think it's very common, but I didn't recognize it when I first started 
with Zope.  People often want to add a little more information about 
their data, and they shouldn't have to do any programming to add 
metadata fields.  Back to my photographs.

In the future, to add metadata to the photographs I upload to my little 
site, I create a schema.  The schema includes the fields "description", 
"location", and "subjects", among others.  I create a "photograph" 
content type and a factory, then declare that all photographs should use 
the metadata schema I created.  I create a form based on the schema and 
start uploading photographs.

Now I want to make it easy to find photographs based on any of the 
fields in my schema.  I create a catalog and tell it to index all 
photograph objects based on my schema.  Then I create a search form, 
based on the metadata entry form, that again uses the same schema to 
perform queries.  It all works, without writing code, and I extol Zope 
3. :-)

> It would be straightforward to write a bit of code in a persistent 
> module to do that.

Ok.

Shane