From 59ffe5bc5287cd07dd377215286165f297bd5ed0 Mon Sep 17 00:00:00 2001 From: "Jens W. Klein" Date: Thu, 28 Mar 2019 16:13:11 +0100 Subject: [PATCH] missing class --- plone/app/z3cform/factories.py | 16 ++++++++++++++++ plone/app/z3cform/widget.py | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/plone/app/z3cform/factories.py b/plone/app/z3cform/factories.py index e69de29b..0bddc811 100644 --- a/plone/app/z3cform/factories.py +++ b/plone/app/z3cform/factories.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +from zope.interface import implementer +from plone.namedfile.storages import MAXCHUNKSIZE +from plone.namedfile.interfaces import IStorage + + +@implementer(IStorage) +class Zope2FileUploadStorable(object): + + def store(self, data, blob): + data.seek(0) + with blob.open('w') as fp: + block = data.read(MAXCHUNKSIZE) + while block: + fp.write(block) + block = data.read(MAXCHUNKSIZE) diff --git a/plone/app/z3cform/widget.py b/plone/app/z3cform/widget.py index e24f55e8..7d9fd48d 100644 --- a/plone/app/z3cform/widget.py +++ b/plone/app/z3cform/widget.py @@ -3,6 +3,7 @@ from Acquisition import ImplicitAcquisitionWrapper from lxml import etree from OFS.interfaces import ISimpleItem +from plone.app.event.base import first_weekday from plone.app.textfield.value import RichTextValue from plone.app.textfield.widget import RichTextWidget as patext_RichTextWidget from plone.app.vocabularies.terms import TermWithDescription @@ -10,7 +11,6 @@ from plone.app.widgets.base import InputWidget from plone.app.widgets.base import SelectWidget as BaseSelectWidget from plone.app.widgets.base import TextareaWidget -from plone.app.widgets.utils import first_weekday from plone.app.widgets.utils import get_context_url from plone.app.widgets.utils import get_date_options from plone.app.widgets.utils import get_datetime_options