示例#1
0
    def _extract_content(self):
        if self.picture:
            result = get_files_data([self.picture])
            if result:
                return result[0]

        html_content = getattr(self, 'html_content', '')
        if html_content:
            return {'content': html_content, 'type': 'html'}

        return {'content': '', 'type': 'none'}
示例#2
0
    def _extract_content(self):
        if self.picture:
            result = get_files_data([self.picture])
            if result:
                return result[0]

        html_content = getattr(self, 'html_content', '')
        if html_content:
            return {'content': html_content,
                    'type': 'html'}

        return {'content': '',
                'type': 'none'}
示例#3
0
 def get_all_attached_files_data(self):
     files = list(self.attached_files)
     files.append(self.image)
     return get_files_data(files)
示例#4
0
 def get_attached_files_data(self):
     return get_files_data(self.attached_files)
示例#5
0
 def get_attached_files_data(self):
     return get_files_data(self.attached_files)
示例#6
0
 def get_all_attached_files_data(self):
     files = list(self.attached_files)
     files.append(self.image)
     return get_files_data(files)