[Zope-CMF] How do I add new metadata values?

Doug Hellmann doug@hellfly.net
Thu, 19 Sep 2002 16:47:53 -0400


I am building a CMF-based portal for our development documentation, and I 
want to add a new required metadata attribute to all of the objects.  I went 
to the metadata tool and added the element, marked it required, gave it a 
vocabulary, etc.  Then I figured out that I had to add the edit field to my 
metadata_edit_form myself, so I did that.  That's where the problem came up.

I added this to the bottom of the table in metadata_edit_form:

 <tr valign="top">
       <th align="right"> Product Version </th>

    <td>
    <select name="ProductVersion"
            tal:define="val here/ProductVersion">
        <option value="1.0"
                tal:attributes="selected python: val == '1.0'"> 1.0 </option>
        <option value="1.01"
                tal:attributes="selected python: val == '1.01'"> 1.01 
</option>
        <option value="1.1"
                tal:attributes="selected python: val == '1.1'"> 1.1 </option>
     </select>

    </td>
</tr>


but now when I view the form I get an error that ProductVersion is "not 
found in 'here/ProductVersion'".  I take that to mean that my document 
does not actually have the new attribute.  I tried creating a new document, 
thinking that the schema change had not been applied to the existing object, 
but that had no appreciable effect.

I looked through all the HowTos and FAQs I could find, as well as the mailing 
list archives, and found nothing that helped.  I did find discussions about 
how to change the defaults for the existing metadata values, but nothing 
about adding a new value.  Am I misunderstanding the way the metadata tool 
works?

Thanks,
Doug