ploneintranet.attachments package¶
Submodules¶
ploneintranet.attachments.attachments module¶
-
class
ploneintranet.attachments.attachments.
AttachmentStorage
¶ Bases:
OFS.Traversable.Traversable
,persistent.Persistent
,ExplicitAcquirer
The attachment storage is a container for all attachments on content objects (that provide IAttachmentStoragable).
All objects including non-folderish ones, can be adapted to store attachments, since attached objects are not stored inside the object, but inside this AttachmentStorage container (which is stored as an annotation on the object being attached to).
-
add
(attachment)¶
-
get
(id)¶
-
getId
()¶ Get the id of the storage. This is used to construct a URL.
-
init_storage
()¶
-
keys
()¶
-
remove
(id)¶
-
values
()¶
-
-
ploneintranet.attachments.attachments.
AttachmentStorageAdapterFactory
(content)¶ Adapter factory to fetch the attachment storage from annotations.
-
interface
ploneintranet.attachments.attachments.
IAttachmentStoragable
¶ Bases:
zope.annotation.interfaces.IAnnotatable
Marker interface for things that can have attachments
ploneintranet.attachments.interfaces module¶
Module where all interfaces, events and exceptions live.
-
interface
ploneintranet.attachments.interfaces.
IAttachmentInfo
¶ Bases:
zope.interface.Interface
Interface for helper view to get attachment information
-
get_attachment_ids
()¶ Get the list of ids of all attachments of the context
-
-
interface
ploneintranet.attachments.interfaces.
IPloneintranetAttachmentsLayer
¶ Bases:
zope.interface.Interface
Marker interface that defines a Zope 3 browser layer.
ploneintranet.attachments.testing module¶
ploneintranet.attachments.utils module¶
-
ploneintranet.attachments.utils.
add_attachments
(attachments, attachment_storage)¶
-
ploneintranet.attachments.utils.
clean_up_temporary_attachments
(workspace, maxage=1)¶ Garbage collect temporary attachments on a workspace – these are used while creating a statusupdate but already removed when storing the statusupdate. This method removes any remaining temp attachments. maxage is age in days beyond which attachments are removed.
-
ploneintranet.attachments.utils.
create_attachment
(filename, data)¶ Set up a contextless dexterity file to hold the attachment data
-
ploneintranet.attachments.utils.
extract_and_add_attachments
(file_upload, obj, workspace=None, token=None)¶ Create attachments from a file upload field.
Extract file data from file_upload, create file/image objects and add them as attachments to obj. If workspace and token are given, reuse previously uploaded temporary attachments if they exist.
-
ploneintranet.attachments.utils.
extract_attachments
(file_upload, workspace=None, token=None)¶
-
ploneintranet.attachments.utils.
pop_temporary_attachment
(workspace, file_field, token)¶ Replace a temporary attachment on the workspace with the uploaded data