[Zope-CMF] Updating Metadata...

Tres Seaver tseaver@zope.com
Fri, 28 Sep 2001 07:16:11 -0400


Josef Albert Meile wrote:

> I have two questions about metadata:
> 1) How can I change the metadata without showing the
> metadata_edit_form? I am asking the user for the metadata in my
> editForm.


In the method your form posts to, add a call to 'context.editMetadata()',
passing the values you want to set as keyword arguments.  See the
'metadata_edit' PythonScript in the 'content' skin.


> 2) I have a new product which has a new field called country. How can
> I add this field to the portal's metadata?


You can define metadata policies for new elements on the 'portal_metadata'
tool.  In your case, I imagine you want to set up a controlled vocabulary
for it;  it should work just as the 'Subject' field does, perhaps with only
a single value allowed.

Tres.
-- 
===============================================================
Tres Seaver                                tseaver@zope.com
Zope Corporation      "Zope Dealers"       http://www.zope.com