[Zope] Re: changing select metadata

Tres Seaver tseaver at zope.com
Thu Apr 21 14:20:31 EDT 2005


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Malthe Borch wrote:
> Hello list, ---
> 
> A quickie:
> 
> I'm trying to change the expiration date of an object with this code:
>   
>   obj = getattr(context, id)
>   obj.editMetadata(expiration_date=...)
> 
> which works very well, however all other metadata gets wiped out :( Now, what's
> the method that works the other way, i.e. only change the provided attributes
> and leave the others be?

This question is CMF-specific, and thus belongs on the zope-cmf list
(zope-cmf at lists.zope.org).  The API for setting individual methods is
defined in Products/CMFCore/interfaces/DubliinCore in the
MutableDublinCore interface;  in particular, you want:

   obj.setExpirationDate(value)

Tres.
- --
===============================================================
Tres Seaver                                tseaver at zope.com
Zope Corporation      "Zope Dealers"       http://www.zope.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFCZ+7vGqWXf00rNCgRApwyAKCFFYE7fk+wWweHO1OKwpTq+OcA4QCfS3GJ
OES23ogaVF94CQrfy13BqBI=
=0jzG
-----END PGP SIGNATURE-----



More information about the Zope mailing list