-
-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #194 from plone/changes-for-plone.app.z3cform
get_ajaxselect_options is no longer used in plone.app.z3cform
- Loading branch information
Showing
7 changed files
with
61 additions
and
138 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Deprecate ``get_ajaxselect_options`` (no longer used). | ||
``IWidgetsLayer`` and ``IWidgetsView`` are no longer used, remove them. | ||
Deprecated ``IFileFactory`` import, use ``zope.filerepresentation`` instead. | ||
Hard depend on ``plone.app.event``, it is meanwhile a dependenciy of Plone core. | ||
Move ``IFieldPermissionChecker`` and ``Zope2FileUploadStorable`` to ``plone.app.z3cform`` in order to slowly fade out this package. | ||
Use util ``first_weekday`` from ``plone.app.event`` and do not duplicate here; deprecated import placed. | ||
[jensens] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,9 @@ | ||
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) | ||
|
||
fp = blob.open('w') | ||
block = data.read(MAXCHUNKSIZE) | ||
while block: | ||
fp.write(block) | ||
block = data.read(MAXCHUNKSIZE) | ||
fp.close() | ||
# -*- coding: utf-8 -*- | ||
import zope.deferredimport | ||
|
||
# can be removed in Plone 6 | ||
zope.deferredimport.initialize() | ||
zope.deferredimport.deprecated( | ||
'Import Zope2FileUploadStorable from plone.app.z3cform.factories instead', | ||
Zope2FileUploadStorable='plone.app.z3cform.factories:Zope2FileUploadStorable', | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,14 @@ | ||
from zope.interface import Interface | ||
from plone.app.z3cform.interfaces import IPloneFormLayer | ||
from zope.filerepresentation.interfaces import IFileFactory | ||
|
||
|
||
class IWidgetsLayer(IPloneFormLayer): | ||
"""Browser layer used to indicate that plone.app.widgets is installed | ||
""" | ||
|
||
|
||
class IWidgetsView(Interface): | ||
"""A view that gives access to various widget related functions. | ||
""" | ||
|
||
def getVocabulary(): | ||
"""Returns vocabulary | ||
""" | ||
|
||
def bodyDataOptions(): | ||
"""Returns the data attributes to be used on the body tag. | ||
""" | ||
|
||
|
||
class IFieldPermissionChecker(Interface): | ||
"""Adapter factory for checking whether a user has permission to | ||
edit a specific field on a content object. | ||
""" | ||
|
||
def validate(field_name, vocabulary_name=None): | ||
"""Returns True if the current user has permission to edit the | ||
`field_name` field. Returns False if the user does not have | ||
permission. Raises and AttributeError if the field cannot be | ||
found. | ||
""" | ||
# -*- coding: utf-8 -*- | ||
import zope.deferredimport | ||
|
||
# FileFactory only needed by ATContentTypes | ||
zope.deferredimport.initialize() | ||
zope.deferredimport.deprecated( | ||
'Import IFileFactory from zope.filerepresentation.interfaces instead', | ||
IFileFactory='zope.filerepresentation.interfaces:IFileFactory', | ||
) | ||
|
||
zope.deferredimport.deprecated( | ||
'Import IFieldPermissionChecker from plone.app.z3cform.interfaces instead', | ||
IFieldPermissionChecker='plone.app.z3cform.interfaces:IFieldPermissionChecker', # noqa | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters