Attachment storage for the Plone intranet suite
Make a content type support attachments by having it implement IAttachmentStoragable. The provided adapter is used to add and retrieve values:
>>> storage = IAttachmentStorage(obj)
>>> storage.add('test.doc', attachment_obj)
>>> retrieved = storage.get('test.doc')
To list the ids of available attachments:
>>> storage.keys()
To delete an attachment:
>>> storage.remove('test.doc')
Attachments can be accessed ttw using the ++attachments++ namespace (/path/to/object/++attachments++default/test.doc).
To install ploneintranet.attachments you simply add ploneintranet.attachments
to the list of eggs in your buildout, run buildout and restart Plone.
Then, install ploneintranet.attachments using the Add-ons control panel.
This package is Copyright (c) Plone Foundation.
Any contribution to this package implies consent and intent to irrevocably transfer all copyrights on the code you contribute, to the Plone Foundation, under the condition that the code remains under a OSI-approved license.
To contribute, you need to have signed a Plone Foundation contributor agreement. If you're listed on Github as a member of the Plone organization, you already signed.