[Zope-dev] Problems with CatalogAware?
Toby Dickenson
tdickenson@geminidataloggers.com
Tue, 11 Sep 2001 08:45:33 +0100
On Mon, 10 Sep 2001 09:40:46 -0700, sean.upton@uniontrib.com wrote:
>def manage_addAdItem(self, id, title, REQUEST=3DNone):
> """Zope managment interface create method for AdItem"""
>
> ad=3DAdItem(id)
I assume the __init__ of AdItem that sets the default values that you
mentioned
> ad.setId(id)
> ad.setTitle(title)
> if REQUEST is not None:
> ad.setAdBody(REQUEST['adBody'])
> if (len(REQUEST['keywords']) > 0):
> ad.setKeys(REQUEST['keywords'])
> ad.setAdDateMulti(yyyy=3DREQUEST['Adyyyy'], mm=3DREQUEST['Admm'],
>dd=3DREQUEST['Addd'])
> ad.setRtDateMulti(yyyy=3DREQUEST['Rtyyyy'], mm=3DREQUEST['Rtmm'],
>dd=3DREQUEST['Rtdd'])
> ad.featureURL=3DREQUEST['featureURL']
You overwrite all the defaults with the real values... .good.
> self._setObject(id, ad)
You add the new object to the folder. The folder calls
ad.manage_afterAdd (or whatever its called), which in the case of
CatalogAware calls index_object.
Everything looks right to me. The catalog should contain the real
values.
Toby Dickenson
tdickenson@geminidataloggers.com