hi! how do you make zope update the catalog automatically whenever a file has been uploaded? thanks! --------------------------------- Do you Yahoo!? Y! Web Hosting - Let the expert host your web site
On Mon, 21 Oct 2002 02:00:41 -0700 (PDT) "michael.tañag" <almightymike@yahoo.com> wrote:
hi! how do you make zope update the catalog automatically whenever a file has been uploaded?
Some options for you: 1. Use the CMF, CMF files already do this 2. Write a python script which adds the file and then indexes it, make this python script the target action of the file upload form. Something like:: form = context.REQUEST.form context.manage_addFile(id=form['id'], file=form['file']) file = context[form['id']] context.Catalog.catalog_object(file) context.REQUEST.RESPONSE.redirect('/some/page') 3. Create your own File class that subclasses OFS.Image.File and mixes in the Products.ZCatalog.CatalogPathAwareness.CatalogAware class. #1 and #3 are more complete solutions, but #2 is more customized. hth, -Casey
participants (2)
-
Casey Duncan -
michael.ta�ag