Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 6 additions & 20 deletions imio/dms/mail/adapters.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from AccessControl import getSecurityManager
from collective.classification.folder.interfaces import IServiceInCharge
from collective.classification.folder.interfaces import IServiceInCopy
from collective.collabora.adapters import DXStoredFile
from collective.collabora.interfaces import IStoredFile
from collective.contact.core.content.held_position import IHeldPosition
from collective.contact.core.content.organization import IOrganization
Expand Down Expand Up @@ -1050,26 +1051,11 @@ def get(self):

@adapter(IPODTemplate)
@implementer(IStoredFile)
class StoredPodTemplate(object):
class StoredPodTemplate(DXStoredFile):
"""Access the file storage on a PODTemplate content object.

i.e. the file attribute on the content object.
i.e. the ``odt_file`` attribute on the content object.
"""

def __init__(self, context):
self.context = context
self.filename = context.odt_file.filename
self.contentType = context.odt_file.contentType

@property
def data(self):
return self.context.odt_file.data

@data.setter
def data(self, data):
self.context.odt_file = NamedBlobFile(
data=data, filename=self.filename, contentType=self.contentType
)

def getSize(self):
return self.context.odt_file.getSize()
# this re-uses the collective.collabora adapter, with only a different
# file_field_name
file_field_name = "odt_file"
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#! -*- coding: utf8 -*-
#! -*- coding: utf-8 -*-

from setuptools import find_packages
from setuptools import setup
Expand Down Expand Up @@ -48,6 +48,7 @@
"collective.ckeditor",
"collective.ckeditortemplates",
"collective.classification.folder",
"collective.collabora>=1.1.0",
"collective.contact.core",
"collective.contact.contactlist",
"collective.contact.duplicated",
Expand Down