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'}
def get_all_attached_files_data(self): files = list(self.attached_files) files.append(self.image) return get_files_data(files)
def get_attached_files_data(self): return get_files_data(self.attached_files)