Skip to content

Instantly share code, notes, and snippets.

@wengole
Forked from simonedeponti/attachments.py
Last active August 29, 2015 14:22
Show Gist options
  • Save wengole/a24a679f90c3d2370a64 to your computer and use it in GitHub Desktop.
Save wengole/a24a679f90c3d2370a64 to your computer and use it in GitHub Desktop.
def extract_and_add(file_upload, obj, workspace=None, token=None):
"""Extracts temporary attachments from storage and attaches them into `obj`
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.
"""
# -*- coding: utf-8 -*-
def get(obj):
"""Get the preview images for the given object
If there are currently no previews an empty list will be returned
:param obj: The Plone object to get previews for
:type obj: A Plone content object
:return: The preview images
:rtype: list
"""
return []
def create(obj, request):
"""Generate the preview images for the given content object
:param obj: The Plone object to get previews for
:type obj: A Plone content object
:param request: The Plone request object
:type request: HTTPRequest
"""
pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment