swimlane.core.fields.attachment module

class swimlane.core.fields.attachment.AttachmentCursor(field, initial_elements=None)[source]

Bases: swimlane.core.fields.base.cursor.FieldCursor

Allows creation and iteration of attachments

add(filename, stream, content_type=None)[source]

Upload a new attachment, and add it to current fields raw data to be persisted on save

Can optionally manually set the content_type, will be guessed by provided filename extension and default to application/octet-stream if it cannot be guessed

class swimlane.core.fields.attachment.AttachmentsField(*args, **kwargs)[source]

Bases: swimlane.core.fields.base.ReadOnly, swimlane.core.fields.base.cursor.CursorField

cursor_class

alias of AttachmentCursor

field_type = 'Core.Models.Fields.AttachmentField, Core'
get_initial_elements()[source]