[Silva-general] How to edit a metadata element of a Silva Document programmatically?

Guido Wesdorp guido at infrae.com
Fri Mar 10 12:49:18 CET 2006

Nico Grubert wrote:
> I'd like to do something like this:
> context.service_metadata.setMetadataValue(mysilvadoc, myset,
> element_name, element_value)
I don't think it's as easy... I can find functionality to set the values
of a whole set at once, but not for a single field (perhaps I'm just not
looking at the right places, though, so it probably makes some sense to
scan SilvaMetadata yourself a bit, too):

binding = self.service_metadata.getMetadata(object)
binding.setValues('my-metadata-set', {'name1': value1,
					'name2': value2})

Hope that helps.



More information about the Silva-general mailing list