plone.api 2.0.9__tar.gz → 2.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. {plone.api-2.0.9 → plone_api-2.2.0}/CHANGES.rst +42 -3
  2. {plone.api-2.0.9 → plone_api-2.2.0}/PKG-INFO +61 -11
  3. {plone.api-2.0.9 → plone_api-2.2.0}/docs/content.md +15 -0
  4. plone_api-2.2.0/pyproject.toml +177 -0
  5. plone_api-2.2.0/setup.cfg +23 -0
  6. {plone.api-2.0.9 → plone_api-2.2.0}/setup.py +25 -13
  7. {plone.api-2.0.9 → plone_api-2.2.0}/src/plone/api/configure.zcml +2 -1
  8. {plone.api-2.0.9 → plone_api-2.2.0}/src/plone/api/content.py +9 -5
  9. {plone.api-2.0.9 → plone_api-2.2.0}/src/plone/api/env.py +1 -1
  10. {plone.api-2.0.9 → plone_api-2.2.0}/src/plone/api/portal.py +2 -2
  11. {plone.api-2.0.9 → plone_api-2.2.0}/src/plone/api/profiles/testfixture/metadata.xml +1 -1
  12. plone_api-2.2.0/src/plone/api/profiles/testfixture/types/Dexterity_Folder.xml +62 -0
  13. plone_api-2.2.0/src/plone/api/profiles/testfixture/types/Dexterity_Item.xml +62 -0
  14. plone_api-2.2.0/src/plone/api/profiles/testfixture/types.xml +11 -0
  15. {plone.api-2.0.9 → plone_api-2.2.0}/src/plone/api/relation.py +10 -10
  16. plone_api-2.2.0/src/plone/api/testing.zcml +21 -0
  17. {plone.api-2.0.9 → plone_api-2.2.0}/src/plone/api/tests/Dexterity_Folder.xml +2 -2
  18. {plone.api-2.0.9 → plone_api-2.2.0}/src/plone/api/tests/Dexterity_Item.xml +2 -2
  19. {plone.api-2.0.9 → plone_api-2.2.0}/src/plone/api/tests/doctests/content.md +15 -0
  20. {plone.api-2.0.9 → plone_api-2.2.0}/src/plone/api/tests/test_content.py +17 -1
  21. {plone.api-2.0.9 → plone_api-2.2.0}/src/plone/api/tests/test_doctests.py +1 -1
  22. {plone.api-2.0.9 → plone_api-2.2.0}/src/plone/api/tests/test_env.py +5 -4
  23. {plone.api-2.0.9 → plone_api-2.2.0}/src/plone/api/tests/test_group.py +1 -1
  24. {plone.api-2.0.9 → plone_api-2.2.0}/src/plone/api/tests/test_portal.py +1 -1
  25. {plone.api-2.0.9 → plone_api-2.2.0}/src/plone/api/tests/test_user.py +1 -1
  26. {plone.api-2.0.9 → plone_api-2.2.0}/src/plone/api/user.py +13 -2
  27. {plone.api-2.0.9 → plone_api-2.2.0}/src/plone/api/validation.py +1 -1
  28. {plone.api-2.0.9 → plone_api-2.2.0}/src/plone.api.egg-info/PKG-INFO +61 -11
  29. {plone.api-2.0.9 → plone_api-2.2.0}/src/plone.api.egg-info/requires.txt +17 -5
  30. plone_api-2.2.0/tox.ini +317 -0
  31. plone.api-2.0.9/pyproject.toml +0 -30
  32. plone.api-2.0.9/setup.cfg +0 -50
  33. plone.api-2.0.9/src/plone/api/profiles/testfixture/types/Dexterity_Folder.xml +0 -40
  34. plone.api-2.0.9/src/plone/api/profiles/testfixture/types/Dexterity_Item.xml +0 -40
  35. plone.api-2.0.9/src/plone/api/profiles/testfixture/types.xml +0 -5
  36. plone.api-2.0.9/src/plone/api/testing.zcml +0 -17
  37. plone.api-2.0.9/tox.ini +0 -208
  38. {plone.api-2.0.9 → plone_api-2.2.0}/CONTRIBUTING.rst +0 -0
  39. {plone.api-2.0.9 → plone_api-2.2.0}/LICENSE +0 -0
  40. {plone.api-2.0.9 → plone_api-2.2.0}/MANIFEST.in +0 -0
  41. {plone.api-2.0.9 → plone_api-2.2.0}/README.md +0 -0
  42. {plone.api-2.0.9 → plone_api-2.2.0}/docs/about.md +0 -0
  43. {plone.api-2.0.9 → plone_api-2.2.0}/docs/env.md +0 -0
  44. {plone.api-2.0.9 → plone_api-2.2.0}/docs/group.md +0 -0
  45. {plone.api-2.0.9 → plone_api-2.2.0}/docs/index.md +0 -0
  46. {plone.api-2.0.9 → plone_api-2.2.0}/docs/portal.md +0 -0
  47. {plone.api-2.0.9 → plone_api-2.2.0}/docs/relation.md +0 -0
  48. {plone.api-2.0.9 → plone_api-2.2.0}/docs/user.md +0 -0
  49. {plone.api-2.0.9 → plone_api-2.2.0}/src/plone/__init__.py +0 -0
  50. {plone.api-2.0.9 → plone_api-2.2.0}/src/plone/api/__init__.py +0 -0
  51. {plone.api-2.0.9 → plone_api-2.2.0}/src/plone/api/exc.py +0 -0
  52. {plone.api-2.0.9 → plone_api-2.2.0}/src/plone/api/group.py +0 -0
  53. {plone.api-2.0.9 → plone_api-2.2.0}/src/plone/api/tests/__init__.py +0 -0
  54. {plone.api-2.0.9 → plone_api-2.2.0}/src/plone/api/tests/base.py +0 -0
  55. {plone.api-2.0.9 → plone_api-2.2.0}/src/plone/api/tests/doctests/about.md +0 -0
  56. {plone.api-2.0.9 → plone_api-2.2.0}/src/plone/api/tests/doctests/env.md +0 -0
  57. {plone.api-2.0.9 → plone_api-2.2.0}/src/plone/api/tests/doctests/group.md +0 -0
  58. {plone.api-2.0.9 → plone_api-2.2.0}/src/plone/api/tests/doctests/portal.md +0 -0
  59. {plone.api-2.0.9 → plone_api-2.2.0}/src/plone/api/tests/doctests/relation.md +0 -0
  60. {plone.api-2.0.9 → plone_api-2.2.0}/src/plone/api/tests/doctests/user.md +0 -0
  61. {plone.api-2.0.9 → plone_api-2.2.0}/src/plone/api/tests/test_relation.py +0 -0
  62. {plone.api-2.0.9 → plone_api-2.2.0}/src/plone/api/tests/test_validation.py +0 -0
  63. {plone.api-2.0.9 → plone_api-2.2.0}/src/plone.api.egg-info/SOURCES.txt +0 -0
  64. {plone.api-2.0.9 → plone_api-2.2.0}/src/plone.api.egg-info/dependency_links.txt +0 -0
  65. {plone.api-2.0.9 → plone_api-2.2.0}/src/plone.api.egg-info/namespace_packages.txt +0 -0
  66. {plone.api-2.0.9 → plone_api-2.2.0}/src/plone.api.egg-info/not-zip-safe +0 -0
  67. {plone.api-2.0.9 → plone_api-2.2.0}/src/plone.api.egg-info/top_level.txt +0 -0
@@ -8,6 +8,45 @@ Changelog
8
8
 
9
9
  .. towncrier release notes start
10
10
 
11
+ 2.2.0 (2024-05-06)
12
+ ------------------
13
+
14
+ New features:
15
+
16
+
17
+ - Report if a permission does not exist
18
+ when calling `api.user.has_permission`.
19
+ [gforcada] (#515)
20
+
21
+
22
+ Bug fixes:
23
+
24
+
25
+ - In relation.create: Fix edge case where existing RelationList value is None. @davisagli (#535)
26
+
27
+
28
+ Internal:
29
+
30
+
31
+ - Update configuration files.
32
+ [plone devs] (cfffba8c)
33
+
34
+
35
+ 2.1.0 (2024-02-22)
36
+ ------------------
37
+
38
+ New features:
39
+
40
+
41
+ - Implemented unrestricted find of content types. @gogobd (#312)
42
+
43
+
44
+ Internal:
45
+
46
+
47
+ - Enhanced Makefile paths to address whitespace compatibility issues. @Vivek-04022001 (#530)
48
+
49
+
11
50
  2.0.9 (2024-02-12)
12
51
  ------------------
13
52
 
@@ -69,8 +108,8 @@ Bug fixes:
69
108
 
70
109
 
71
110
  - Do not run GitHub Actions tests twice.
72
- Only run GitHub Actions tests when commiting directly against master or main or
73
- opening a pull request agains master or main. This avoids to run the same test
111
+ Only run GitHub Actions tests when committing directly against master or main or
112
+ opening a pull request against master or main. This avoids to run the same test
74
113
  suite for the same environment twice.
75
114
  [thet] (#0)
76
115
  - Mockup TinyMCE settings: Remove unused AtD related views.
@@ -459,7 +498,7 @@ Bug fixes:
459
498
  - Simplify the ``plone.api.content.delete`` method.
460
499
  [thet]
461
500
 
462
- - content.copy with safe_id=False should raise it's own exeception. Fixes #340
501
+ - content.copy with safe_id=False should raise it's own exception. Fixes #340
463
502
  [jaroel]
464
503
 
465
504
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: plone.api
3
- Version: 2.0.9
3
+ Version: 2.2.0
4
4
  Summary: A Plone API.
5
5
  Home-page: https://github.com/plone/plone.api
6
6
  Author: Plone Foundation
@@ -22,24 +22,37 @@ Classifier: Programming Language :: Python :: 3.9
22
22
  Classifier: Programming Language :: Python :: 3.10
23
23
  Classifier: Programming Language :: Python :: 3.11
24
24
  Requires-Python: >=3.8
25
+ Description-Content-Type: text/x-rst
25
26
  License-File: LICENSE
26
27
  Requires-Dist: Products.statusmessages
28
+ Requires-Dist: Products.PlonePAS
29
+ Requires-Dist: Products.CMFPlone
27
30
  Requires-Dist: decorator
28
31
  Requires-Dist: plone.app.uuid
32
+ Requires-Dist: plone.app.dexterity
33
+ Requires-Dist: plone.app.intid
34
+ Requires-Dist: plone.app.layout
29
35
  Requires-Dist: plone.app.linkintegrity
36
+ Requires-Dist: plone.dexterity
37
+ Requires-Dist: plone.i18n
38
+ Requires-Dist: plone.registry
30
39
  Requires-Dist: plone.uuid
31
40
  Requires-Dist: setuptools
32
41
  Requires-Dist: zope.globalrequest
42
+ Requires-Dist: Products.CMFCore
43
+ Requires-Dist: z3c.relationfield
44
+ Requires-Dist: zc.relation
45
+ Requires-Dist: Zope
46
+ Requires-Dist: zope.intid
33
47
  Provides-Extra: test
34
- Requires-Dist: Products.CMFPlone; extra == "test"
48
+ Requires-Dist: borg.localrole; extra == "test"
35
49
  Requires-Dist: manuel>=1.11.2; extra == "test"
36
- Requires-Dist: plone.app.dexterity; extra == "test"
37
- Requires-Dist: plone.app.intid; extra == "test"
50
+ Requires-Dist: plone.app.contenttypes; extra == "test"
51
+ Requires-Dist: plone.app.textfield; extra == "test"
38
52
  Requires-Dist: plone.app.testing; extra == "test"
53
+ Requires-Dist: plone.testing; extra == "test"
39
54
  Requires-Dist: plone.indexer; extra == "test"
40
55
  Requires-Dist: plone.registry; extra == "test"
41
- Requires-Dist: z3c.relationfield; extra == "test"
42
- Requires-Dist: zope.testrunner; extra == "test"
43
56
 
44
57
  # plone.api
45
58
 
@@ -88,7 +101,6 @@ Code Coverage
88
101
  is measured at [Coveralls.io](https://coveralls.io/github/plone/plone.api).
89
102
 
90
103
 
91
-
92
104
  Changelog
93
105
  =========
94
106
 
@@ -99,6 +111,45 @@ Changelog
99
111
 
100
112
  .. towncrier release notes start
101
113
 
114
+ 2.2.0 (2024-05-06)
115
+ ------------------
116
+
117
+ New features:
118
+
119
+
120
+ - Report if a permission does not exist
121
+ when calling `api.user.has_permission`.
122
+ [gforcada] (#515)
123
+
124
+
125
+ Bug fixes:
126
+
127
+
128
+ - In relation.create: Fix edge case where existing RelationList value is None. @davisagli (#535)
129
+
130
+
131
+ Internal:
132
+
133
+
134
+ - Update configuration files.
135
+ [plone devs] (cfffba8c)
136
+
137
+
138
+ 2.1.0 (2024-02-22)
139
+ ------------------
140
+
141
+ New features:
142
+
143
+
144
+ - Implemented unrestricted find of content types. @gogobd (#312)
145
+
146
+
147
+ Internal:
148
+
149
+
150
+ - Enhanced Makefile paths to address whitespace compatibility issues. @Vivek-04022001 (#530)
151
+
152
+
102
153
  2.0.9 (2024-02-12)
103
154
  ------------------
104
155
 
@@ -160,8 +211,8 @@ Bug fixes:
160
211
 
161
212
 
162
213
  - Do not run GitHub Actions tests twice.
163
- Only run GitHub Actions tests when commiting directly against master or main or
164
- opening a pull request agains master or main. This avoids to run the same test
214
+ Only run GitHub Actions tests when committing directly against master or main or
215
+ opening a pull request against master or main. This avoids to run the same test
165
216
  suite for the same environment twice.
166
217
  [thet] (#0)
167
218
  - Mockup TinyMCE settings: Remove unused AtD related views.
@@ -550,7 +601,7 @@ Bug fixes:
550
601
  - Simplify the ``plone.api.content.delete`` method.
551
602
  [thet]
552
603
 
553
- - content.copy with safe_id=False should raise it's own exeception. Fixes #340
604
+ - content.copy with safe_id=False should raise it's own exception. Fixes #340
554
605
  [jaroel]
555
606
 
556
607
 
@@ -1142,7 +1193,6 @@ Fixes:
1142
1193
  [davisagli, fulv, iElectric, jcerjak, jonstahl, kcleong, mauritsvanrees,
1143
1194
  wamdam, witsch, zupo]
1144
1195
 
1145
-
1146
1196
  License
1147
1197
  =======
1148
1198
 
@@ -195,6 +195,21 @@ documents = api.content.find(
195
195
  %
196
196
  % self.assertGreater(len(documents), 0)
197
197
 
198
+ Find all `Document` content types, and use unrestricted search results:
199
+
200
+ ```python
201
+ from plone import api
202
+ documents = api.content.find(
203
+ context=api.portal.get(),
204
+ portal_type="Document",
205
+ unrestricted=True,
206
+ )
207
+ ```
208
+
209
+ % invisible-code-block: python
210
+ %
211
+ % self.assertGreater(len(documents), 0)
212
+
198
213
  More information about how to use the catalog may be found in the
199
214
  [Plone Documentation](https://5.docs.plone.org/develop/plone/searching_and_indexing/index.html).
200
215
 
@@ -0,0 +1,177 @@
1
+ # Generated from:
2
+ # https://github.com/plone/meta/tree/main/config/default
3
+ # See the inline comments on how to expand/tweak this configuration file
4
+ [build-system]
5
+ requires = ["setuptools>=68.2"]
6
+
7
+ [tool.towncrier]
8
+ directory = "news/"
9
+ filename = "CHANGES.rst"
10
+ title_format = "{version} ({project_date})"
11
+ underlines = ["-", ""]
12
+
13
+ [[tool.towncrier.type]]
14
+ directory = "breaking"
15
+ name = "Breaking changes:"
16
+ showcontent = true
17
+
18
+ [[tool.towncrier.type]]
19
+ directory = "feature"
20
+ name = "New features:"
21
+ showcontent = true
22
+
23
+ [[tool.towncrier.type]]
24
+ directory = "bugfix"
25
+ name = "Bug fixes:"
26
+ showcontent = true
27
+
28
+ [[tool.towncrier.type]]
29
+ directory = "internal"
30
+ name = "Internal:"
31
+ showcontent = true
32
+
33
+ [[tool.towncrier.type]]
34
+ directory = "documentation"
35
+ name = "Documentation:"
36
+ showcontent = true
37
+
38
+ [[tool.towncrier.type]]
39
+ directory = "tests"
40
+ name = "Tests"
41
+ showcontent = true
42
+
43
+ ##
44
+ # Add extra configuration options in .meta.toml:
45
+ # [pyproject]
46
+ # towncrier_extra_lines = """
47
+ # extra_configuration
48
+ # """
49
+ ##
50
+
51
+ [tool.isort]
52
+ profile = "plone"
53
+
54
+ ##
55
+ # Add extra configuration options in .meta.toml:
56
+ # [pyproject]
57
+ # isort_extra_lines = """
58
+ # extra_configuration
59
+ # """
60
+ ##
61
+
62
+ [tool.black]
63
+ target-version = ["py38"]
64
+
65
+ ##
66
+ # Add extra configuration options in .meta.toml:
67
+ # [pyproject]
68
+ # black_extra_lines = """
69
+ # extra_configuration
70
+ # """
71
+ ##
72
+
73
+ [tool.codespell]
74
+ ignore-words-list = "discreet,manuel"
75
+ skip = "*.po,"
76
+ ##
77
+ # Add extra configuration options in .meta.toml:
78
+ # [pyproject]
79
+ # codespell_ignores = "foo,bar"
80
+ # codespell_skip = "*.po,*.map,package-lock.json"
81
+ ##
82
+
83
+ [tool.dependencychecker]
84
+ Zope = [
85
+ # Zope own provided namespaces
86
+ 'App', 'OFS', 'Products.Five', 'Products.OFSP', 'Products.PageTemplates',
87
+ 'Products.SiteAccess', 'Shared', 'Testing', 'ZPublisher', 'ZTUtils',
88
+ 'Zope2', 'webdav', 'zmi',
89
+ # ExtensionClass own provided namespaces
90
+ 'ExtensionClass', 'ComputedAttribute', 'MethodObject',
91
+ # Zope dependencies
92
+ 'AccessControl', 'Acquisition', 'AuthEncoding', 'beautifulsoup4', 'BTrees',
93
+ 'cffi', 'Chameleon', 'DateTime', 'DocumentTemplate',
94
+ 'MultiMapping', 'multipart', 'PasteDeploy', 'Persistence', 'persistent',
95
+ 'pycparser', 'python-gettext', 'pytz', 'RestrictedPython', 'roman',
96
+ 'soupsieve', 'transaction', 'waitress', 'WebOb', 'WebTest', 'WSGIProxy2',
97
+ 'z3c.pt', 'zc.lockfile', 'ZConfig', 'zExceptions', 'ZODB', 'zodbpickle',
98
+ 'zope.annotation', 'zope.browser', 'zope.browsermenu', 'zope.browserpage',
99
+ 'zope.browserresource', 'zope.cachedescriptors', 'zope.component',
100
+ 'zope.configuration', 'zope.container', 'zope.contentprovider',
101
+ 'zope.contenttype', 'zope.datetime', 'zope.deferredimport',
102
+ 'zope.deprecation', 'zope.dottedname', 'zope.event', 'zope.exceptions',
103
+ 'zope.filerepresentation', 'zope.globalrequest', 'zope.hookable',
104
+ 'zope.i18n', 'zope.i18nmessageid', 'zope.interface', 'zope.lifecycleevent',
105
+ 'zope.location', 'zope.pagetemplate', 'zope.processlifetime', 'zope.proxy',
106
+ 'zope.ptresource', 'zope.publisher', 'zope.schema', 'zope.security',
107
+ 'zope.sequencesort', 'zope.site', 'zope.size', 'zope.structuredtext',
108
+ 'zope.tal', 'zope.tales', 'zope.testbrowser', 'zope.testing',
109
+ 'zope.traversing', 'zope.viewlet'
110
+ ]
111
+ 'Products.CMFCore' = [
112
+ 'docutils', 'five.localsitemanager', 'Missing', 'Products.BTreeFolder2',
113
+ 'Products.GenericSetup', 'Products.MailHost', 'Products.PythonScripts',
114
+ 'Products.StandardCacheManagers', 'Products.ZCatalog', 'Record',
115
+ 'zope.sendmail', 'Zope'
116
+ ]
117
+ 'plone.base' = [
118
+ 'plone.batching', 'plone.registry', 'plone.schema','plone.z3cform',
119
+ 'Products.CMFCore', 'Products.CMFDynamicViewFTI',
120
+ ]
121
+ python-dateutil = ['dateutil']
122
+ ignore-packages = ['Products.PrintingMailHost', 'plone.app.iterate',]
123
+
124
+ ##
125
+ # Add extra configuration options in .meta.toml:
126
+ # [pyproject]
127
+ # dependencies_ignores = "['zestreleaser.towncrier']"
128
+ # dependencies_mappings = [
129
+ # "gitpython = ['git']",
130
+ # "pygithub = ['github']",
131
+ # ]
132
+ ##
133
+
134
+ [tool.check-manifest]
135
+ ignore = [
136
+ ".editorconfig",
137
+ ".flake8",
138
+ ".meta.toml",
139
+ ".pre-commit-config.yaml",
140
+ "dependabot.yml",
141
+ "mx.ini",
142
+ "tox.ini",
143
+ ".editorconfig",
144
+ "*.cfg",
145
+ "constraints_plone52.txt",
146
+ "constraints_plone60.txt",
147
+ "constraints.txt",
148
+ "fix-converted-myst.py",
149
+ "Makefile",
150
+ "netlify.toml",
151
+ "requirements-docs.txt",
152
+ "requirements.txt",
153
+
154
+ ]
155
+
156
+ ##
157
+ # Add extra configuration options in .meta.toml:
158
+ # [pyproject]
159
+ # check_manifest_ignores = """
160
+ # "*.map.js",
161
+ # "*.pyc",
162
+ # """
163
+ # check_manifest_extra_lines = """
164
+ # ignore-bad-ideas = [
165
+ # "some/test/file/PKG-INFO",
166
+ # ]
167
+ # """
168
+ ##
169
+
170
+
171
+ ##
172
+ # Add extra configuration options in .meta.toml:
173
+ # [pyproject]
174
+ # extra_lines = """
175
+ # _your own configuration lines_
176
+ # """
177
+ ##
@@ -0,0 +1,23 @@
1
+ [coverage:run]
2
+ branch = True
3
+ source =
4
+ src
5
+ omit =
6
+ *.rst
7
+ */doctests/*
8
+ */tests/*
9
+
10
+ [coverage:report]
11
+ precision = 2
12
+ omit =
13
+ *.rst
14
+ */doctests/*
15
+ */tests/*
16
+
17
+ [coverage:html]
18
+ directory = _build/coverage
19
+
20
+ [egg_info]
21
+ tag_build =
22
+ tag_date = 0
23
+
@@ -1,24 +1,22 @@
1
+ from pathlib import Path
1
2
  from setuptools import find_packages
2
3
  from setuptools import setup
3
4
 
4
- import os
5
-
6
-
7
- def read(*rnames):
8
- return open(os.path.join(os.path.dirname(__file__), *rnames)).read()
9
5
 
6
+ version = "2.2.0"
10
7
 
11
8
  long_description = (
12
- read("README.md") + "\n\n" + read("CHANGES.rst") + "\n\n" + read("LICENSE")
9
+ f"{Path('README.md').read_text()}\n"
10
+ f"{Path('CHANGES.rst').read_text()}\n"
11
+ f"{Path('LICENSE').read_text()}"
13
12
  )
14
13
 
15
- version = "2.0.9"
16
-
17
14
  setup(
18
15
  name="plone.api",
19
16
  version=version,
20
17
  description="A Plone API.",
21
18
  long_description=long_description,
19
+ long_description_content_type="text/x-rst",
22
20
  author="Plone Foundation",
23
21
  author_email="plone-developers@lists.sourceforge.net",
24
22
  license="GPL version 2",
@@ -32,26 +30,40 @@ setup(
32
30
  python_requires=">=3.8",
33
31
  install_requires=[
34
32
  "Products.statusmessages",
33
+ "Products.PlonePAS",
34
+ "Products.CMFPlone",
35
35
  "decorator",
36
36
  "plone.app.uuid",
37
+ "plone.app.dexterity",
38
+ "plone.app.intid",
39
+ "plone.app.layout",
37
40
  "plone.app.linkintegrity",
41
+ "plone.dexterity",
42
+ "plone.i18n",
43
+ "plone.registry",
38
44
  "plone.uuid",
39
45
  "setuptools",
40
46
  "zope.globalrequest",
47
+ "Products.CMFCore",
48
+ "z3c.relationfield",
49
+ "zc.relation",
50
+ "Zope",
51
+ "zope.intid",
41
52
  ],
42
53
  extras_require={
43
54
  "test": [
44
- "Products.CMFPlone",
55
+ "borg.localrole",
45
56
  "manuel>=1.11.2",
46
- "plone.app.dexterity",
47
- "plone.app.intid",
57
+ "plone.app.contenttypes",
58
+ "plone.app.textfield",
48
59
  "plone.app.testing",
60
+ "plone.testing",
49
61
  "plone.indexer",
50
62
  "plone.registry",
51
- "z3c.relationfield",
52
- "zope.testrunner",
53
63
  ],
54
64
  },
65
+ # Get more strings from
66
+ # https://pypi.org/classifiers/
55
67
  classifiers=[
56
68
  "Development Status :: 5 - Production/Stable",
57
69
  "Environment :: Web Environment",
@@ -1,5 +1,6 @@
1
1
  <configure
2
2
  xmlns="http://namespaces.zope.org/zope"
3
- i18n_domain="plone.api">
3
+ i18n_domain="plone.api"
4
+ >
4
5
 
5
6
  </configure>
@@ -34,7 +34,7 @@ def create(
34
34
  id=None,
35
35
  title=None,
36
36
  safe_id=False,
37
- **kwargs # NOQA: C816, S101
37
+ **kwargs, # NOQA: C816, S101
38
38
  ):
39
39
  """Create a new content item.
40
40
 
@@ -127,7 +127,7 @@ def get(path=None, UID=None):
127
127
  if path:
128
128
  site = portal.get()
129
129
  site_absolute_path = "/".join(site.getPhysicalPath())
130
- if not path.startswith("{path}".format(path=site_absolute_path)):
130
+ if not path.startswith(f"{site_absolute_path}"):
131
131
  path = "{site_path}{relative_path}".format(
132
132
  site_path=site_absolute_path,
133
133
  relative_path=path,
@@ -297,7 +297,7 @@ def delete(obj=None, objects=None, check_linkintegrity=True):
297
297
  breaches = linkintegrity_view.get_breaches(objects)
298
298
  if breaches:
299
299
  raise LinkIntegrityNotificationException(
300
- "Linkintegrity-breaches: {}".format(breaches),
300
+ f"Linkintegrity-breaches: {breaches}",
301
301
  )
302
302
 
303
303
  for obj_ in objects:
@@ -603,12 +603,13 @@ def _parse_object_provides_query(query):
603
603
  return result
604
604
 
605
605
 
606
- def find(context=None, depth=None, **kwargs):
606
+ def find(context=None, depth=None, unrestricted=False, **kwargs):
607
607
  """Find content in the portal.
608
608
 
609
609
  :param context: Context for the search
610
610
  :type obj: Content object
611
611
  :param depth: How far in the content tree we want to search from context
612
+ :param unrestricted: Boolean, use unrestrictedSearchResults if True
612
613
  :type obj: Content object
613
614
  :returns: Catalog brains
614
615
  :rtype: List
@@ -656,4 +657,7 @@ def find(context=None, depth=None, **kwargs):
656
657
  if not valid_indexes:
657
658
  return []
658
659
 
659
- return catalog(**query)
660
+ if unrestricted:
661
+ return catalog.unrestrictedSearchResults(**query)
662
+ else:
663
+ return catalog(**query)
@@ -231,4 +231,4 @@ def zope_version():
231
231
  :returns: string denoting what release of Zope2 this distribution contains
232
232
  :Example: :ref:`env-zope-version-example`
233
233
  """
234
- return get_distribution("Zope2").version
234
+ return get_distribution("Zope").version
@@ -280,7 +280,7 @@ def get_registry_record(name=None, interface=None, default=MISSING):
280
280
  records = registry.forInterface(interface, check=False)
281
281
  _marker = object()
282
282
  if getattr(records, name, _marker) != _marker:
283
- return registry["{}.{}".format(interface.__identifier__, name)]
283
+ return registry[f"{interface.__identifier__}.{name}"]
284
284
 
285
285
  if default is not MISSING:
286
286
  return default
@@ -307,7 +307,7 @@ def get_registry_record(name=None, interface=None, default=MISSING):
307
307
 
308
308
  # Show all records that 'look like' name.
309
309
  # We don't dump the whole list, because it 1500+ items.
310
- msg = "Cannot find a record with name '{name}'".format(name=name)
310
+ msg = f"Cannot find a record with name '{name}'"
311
311
  records = [key for key in registry.records.keys() if name in key]
312
312
  if records:
313
313
  msg = (
@@ -1,4 +1,4 @@
1
- <?xml version="1.0"?>
1
+ <?xml version="1.0" encoding="utf-8"?>
2
2
  <metadata>
3
3
  <version>1</version>
4
4
  <dependencies>
@@ -0,0 +1,62 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <object xmlns:i18n="http://xml.zope.org/namespaces/i18n"
3
+ meta_type="Dexterity FTI"
4
+ name="Dexterity Folder"
5
+ >
6
+ <property name="title">Dexterity Folder</property>
7
+ <property name="description" />
8
+ <property name="content_icon" />
9
+ <property name="link_target" />
10
+ <property name="immediate_view">view</property>
11
+ <property name="global_allow">True</property>
12
+ <property name="filter_content_types">False</property>
13
+ <property name="allowed_content_types" />
14
+ <property name="allow_discussion">False</property>
15
+ <property name="default_view">view</property>
16
+ <property name="view_methods">
17
+ <element value="view" />
18
+ </property>
19
+ <property name="default_view_fallback">False</property>
20
+ <property name="add_permission">cmf.AddPortalContent</property>
21
+ <property name="klass">plone.dexterity.content.Container</property>
22
+ <property name="behaviors">
23
+ <element value="plone.app.dexterity.behaviors.metadata.IDublinCore" />
24
+ </property>
25
+ <property name="schema" />
26
+ <property name="model_source" />
27
+ <property name="model_file">plone.api.tests:Dexterity_Folder.xml</property>
28
+ <alias from="(Default)"
29
+ to="(dynamic view)"
30
+ />
31
+ <alias from="edit"
32
+ to="@@edit"
33
+ />
34
+ <alias from="sharing"
35
+ to="@@sharing"
36
+ />
37
+ <alias from="view"
38
+ to="(selected layout)"
39
+ />
40
+ <action action_id="view"
41
+ category="object"
42
+ condition_expr=""
43
+ icon_expr=""
44
+ link_target=""
45
+ title="View"
46
+ url_expr="string:${object_url}"
47
+ visible="True"
48
+ >
49
+ <permission value="View" />
50
+ </action>
51
+ <action action_id="edit"
52
+ category="object"
53
+ condition_expr=""
54
+ icon_expr=""
55
+ link_target=""
56
+ title="Edit"
57
+ url_expr="string:${object_url}/edit"
58
+ visible="True"
59
+ >
60
+ <permission value="Modify portal content" />
61
+ </action>
62
+ </object>