plone.api 2.2.4__tar.gz → 2.2.5__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 (61) hide show
  1. {plone_api-2.2.4 → plone_api-2.2.5}/CHANGES.rst +23 -0
  2. {plone_api-2.2.4 → plone_api-2.2.5}/MANIFEST.in +2 -0
  3. {plone_api-2.2.4 → plone_api-2.2.5}/PKG-INFO +25 -2
  4. {plone_api-2.2.4 → plone_api-2.2.5}/docs/contribute.md +6 -0
  5. {plone_api-2.2.4 → plone_api-2.2.5}/docs/portal.md +1 -1
  6. {plone_api-2.2.4 → plone_api-2.2.5}/pyproject.toml +2 -2
  7. {plone_api-2.2.4 → plone_api-2.2.5}/setup.py +2 -2
  8. {plone_api-2.2.4 → plone_api-2.2.5}/src/plone/api/content.py +6 -1
  9. {plone_api-2.2.4 → plone_api-2.2.5}/src/plone/api/portal.py +2 -2
  10. {plone_api-2.2.4 → plone_api-2.2.5}/src/plone/api/relation.py +1 -1
  11. {plone_api-2.2.4 → plone_api-2.2.5}/src/plone/api/testing.zcml +1 -1
  12. {plone_api-2.2.4 → plone_api-2.2.5}/src/plone/api/tests/doctests/portal.md +1 -1
  13. {plone_api-2.2.4 → plone_api-2.2.5}/src/plone/api/tests/test_content.py +12 -2
  14. {plone_api-2.2.4 → plone_api-2.2.5}/src/plone/api/tests/test_portal.py +1 -1
  15. {plone_api-2.2.4 → plone_api-2.2.5}/src/plone.api.egg-info/PKG-INFO +25 -2
  16. {plone_api-2.2.4 → plone_api-2.2.5}/src/plone.api.egg-info/requires.txt +1 -1
  17. {plone_api-2.2.4 → plone_api-2.2.5}/tox.ini +13 -1
  18. {plone_api-2.2.4 → plone_api-2.2.5}/CONTRIBUTING.rst +0 -0
  19. {plone_api-2.2.4 → plone_api-2.2.5}/LICENSE +0 -0
  20. {plone_api-2.2.4 → plone_api-2.2.5}/README.md +0 -0
  21. {plone_api-2.2.4 → plone_api-2.2.5}/docs/about.md +0 -0
  22. {plone_api-2.2.4 → plone_api-2.2.5}/docs/content.md +0 -0
  23. {plone_api-2.2.4 → plone_api-2.2.5}/docs/env.md +0 -0
  24. {plone_api-2.2.4 → plone_api-2.2.5}/docs/group.md +0 -0
  25. {plone_api-2.2.4 → plone_api-2.2.5}/docs/index.md +0 -0
  26. {plone_api-2.2.4 → plone_api-2.2.5}/docs/relation.md +0 -0
  27. {plone_api-2.2.4 → plone_api-2.2.5}/docs/user.md +0 -0
  28. {plone_api-2.2.4 → plone_api-2.2.5}/setup.cfg +0 -0
  29. {plone_api-2.2.4 → plone_api-2.2.5}/src/plone/__init__.py +0 -0
  30. {plone_api-2.2.4 → plone_api-2.2.5}/src/plone/api/__init__.py +0 -0
  31. {plone_api-2.2.4 → plone_api-2.2.5}/src/plone/api/configure.zcml +0 -0
  32. {plone_api-2.2.4 → plone_api-2.2.5}/src/plone/api/env.py +0 -0
  33. {plone_api-2.2.4 → plone_api-2.2.5}/src/plone/api/exc.py +0 -0
  34. {plone_api-2.2.4 → plone_api-2.2.5}/src/plone/api/group.py +0 -0
  35. {plone_api-2.2.4 → plone_api-2.2.5}/src/plone/api/profiles/testfixture/metadata.xml +0 -0
  36. {plone_api-2.2.4 → plone_api-2.2.5}/src/plone/api/profiles/testfixture/types/Dexterity_Folder.xml +0 -0
  37. {plone_api-2.2.4 → plone_api-2.2.5}/src/plone/api/profiles/testfixture/types/Dexterity_Item.xml +0 -0
  38. {plone_api-2.2.4 → plone_api-2.2.5}/src/plone/api/profiles/testfixture/types.xml +0 -0
  39. {plone_api-2.2.4 → plone_api-2.2.5}/src/plone/api/tests/Dexterity_Folder.xml +0 -0
  40. {plone_api-2.2.4 → plone_api-2.2.5}/src/plone/api/tests/Dexterity_Item.xml +0 -0
  41. {plone_api-2.2.4 → plone_api-2.2.5}/src/plone/api/tests/__init__.py +0 -0
  42. {plone_api-2.2.4 → plone_api-2.2.5}/src/plone/api/tests/base.py +0 -0
  43. {plone_api-2.2.4 → plone_api-2.2.5}/src/plone/api/tests/doctests/about.md +0 -0
  44. {plone_api-2.2.4 → plone_api-2.2.5}/src/plone/api/tests/doctests/content.md +0 -0
  45. {plone_api-2.2.4 → plone_api-2.2.5}/src/plone/api/tests/doctests/env.md +0 -0
  46. {plone_api-2.2.4 → plone_api-2.2.5}/src/plone/api/tests/doctests/group.md +0 -0
  47. {plone_api-2.2.4 → plone_api-2.2.5}/src/plone/api/tests/doctests/relation.md +0 -0
  48. {plone_api-2.2.4 → plone_api-2.2.5}/src/plone/api/tests/doctests/user.md +0 -0
  49. {plone_api-2.2.4 → plone_api-2.2.5}/src/plone/api/tests/test_doctests.py +0 -0
  50. {plone_api-2.2.4 → plone_api-2.2.5}/src/plone/api/tests/test_env.py +0 -0
  51. {plone_api-2.2.4 → plone_api-2.2.5}/src/plone/api/tests/test_group.py +0 -0
  52. {plone_api-2.2.4 → plone_api-2.2.5}/src/plone/api/tests/test_relation.py +0 -0
  53. {plone_api-2.2.4 → plone_api-2.2.5}/src/plone/api/tests/test_user.py +0 -0
  54. {plone_api-2.2.4 → plone_api-2.2.5}/src/plone/api/tests/test_validation.py +0 -0
  55. {plone_api-2.2.4 → plone_api-2.2.5}/src/plone/api/user.py +0 -0
  56. {plone_api-2.2.4 → plone_api-2.2.5}/src/plone/api/validation.py +0 -0
  57. {plone_api-2.2.4 → plone_api-2.2.5}/src/plone.api.egg-info/SOURCES.txt +0 -0
  58. {plone_api-2.2.4 → plone_api-2.2.5}/src/plone.api.egg-info/dependency_links.txt +0 -0
  59. {plone_api-2.2.4 → plone_api-2.2.5}/src/plone.api.egg-info/namespace_packages.txt +0 -0
  60. {plone_api-2.2.4 → plone_api-2.2.5}/src/plone.api.egg-info/not-zip-safe +0 -0
  61. {plone_api-2.2.4 → plone_api-2.2.5}/src/plone.api.egg-info/top_level.txt +0 -0
@@ -8,6 +8,29 @@ Changelog
8
8
 
9
9
  .. towncrier release notes start
10
10
 
11
+ 2.2.5 (2025-01-24)
12
+ ------------------
13
+
14
+ Bug fixes:
15
+
16
+
17
+ - Fix api.content.get(path=path) when a item in the path is not accessible to the user.
18
+ [pbauer] (#549)
19
+ - Fix DeprecationWarnings. [maurits] (#4090)
20
+
21
+
22
+ Documentation:
23
+
24
+
25
+ - Preview docs on Read the Docs instead of Netlify. @stevepiercy (#545)
26
+ - Remove Netlify stuff, follow up to #545. @stevepiercy
27
+ - Sort and remove duplicate entries in `pyproject.toml`
28
+ - Remove unused docs requirements.
29
+ - Fix comments and remove unnecessary steps from `tox.ini`.
30
+ - Enable copy button for code blocks.
31
+ - Add linkcheck to documentation of documentation. (#546)
32
+
33
+
11
34
  2.2.4 (2024-12-16)
12
35
  ------------------
13
36
 
@@ -13,6 +13,8 @@ global-exclude *.pyc
13
13
  include pyproject.toml
14
14
  recursive-exclude news *
15
15
  exclude news
16
+ recursive-exclude .vscode *
17
+ exclude .readthedocs.yaml
16
18
 
17
19
  # added by check-manifest
18
20
  recursive-include src *.py
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: plone.api
3
- Version: 2.2.4
3
+ Version: 2.2.5
4
4
  Summary: A Plone API.
5
5
  Home-page: https://github.com/plone/plone.api
6
6
  Author: Plone Foundation
@@ -34,8 +34,8 @@ Requires-Dist: decorator
34
34
  Requires-Dist: plone.app.uuid
35
35
  Requires-Dist: plone.app.dexterity
36
36
  Requires-Dist: plone.app.intid
37
- Requires-Dist: plone.app.layout
38
37
  Requires-Dist: plone.app.linkintegrity
38
+ Requires-Dist: plone.base
39
39
  Requires-Dist: plone.dexterity
40
40
  Requires-Dist: plone.i18n
41
41
  Requires-Dist: plone.registry
@@ -110,6 +110,29 @@ Changelog
110
110
 
111
111
  .. towncrier release notes start
112
112
 
113
+ 2.2.5 (2025-01-24)
114
+ ------------------
115
+
116
+ Bug fixes:
117
+
118
+
119
+ - Fix api.content.get(path=path) when a item in the path is not accessible to the user.
120
+ [pbauer] (#549)
121
+ - Fix DeprecationWarnings. [maurits] (#4090)
122
+
123
+
124
+ Documentation:
125
+
126
+
127
+ - Preview docs on Read the Docs instead of Netlify. @stevepiercy (#545)
128
+ - Remove Netlify stuff, follow up to #545. @stevepiercy
129
+ - Sort and remove duplicate entries in `pyproject.toml`
130
+ - Remove unused docs requirements.
131
+ - Fix comments and remove unnecessary steps from `tox.ini`.
132
+ - Enable copy button for code blocks.
133
+ - Add linkcheck to documentation of documentation. (#546)
134
+
135
+
113
136
  2.2.4 (2024-12-16)
114
137
  ------------------
115
138
 
@@ -121,6 +121,12 @@ Alternatively, you can automatically reload changes to the documentation as you
121
121
  tox -e livehtml
122
122
  ```
123
123
 
124
+ You can run a link checker on documentation.
125
+
126
+ ```shell
127
+ tox -e linkcheck
128
+ ```
129
+
124
130
  The [`plone.api` documentation](https://6.docs.plone.org/plone.api) is automatically generated from the documentation source files when its submodule is updated in the [main Plone `documentation` repository](https://github.com/plone/documentation/).
125
131
 
126
132
  ## Add a function to an existing module
@@ -45,7 +45,7 @@ Assuming there is a document `english_page` in a folder `en`, which is the navig
45
45
  % invisible-code-block: python
46
46
  %
47
47
  % from plone import api
48
- % from plone.app.layout.navigation.interfaces import INavigationRoot
48
+ % from plone.base.interfaces import INavigationRoot
49
49
  % from zope.interface import alsoProvides
50
50
  %
51
51
  % portal = api.portal.get()
@@ -140,14 +140,14 @@ ignore = [
140
140
  "dependabot.yml",
141
141
  "mx.ini",
142
142
  "tox.ini",
143
- ".editorconfig",
144
143
  "*.cfg",
144
+ ".editorconfig",
145
+ ".readthedocs.yaml",
145
146
  "constraints_plone52.txt",
146
147
  "constraints_plone60.txt",
147
148
  "constraints.txt",
148
149
  "fix-converted-myst.py",
149
150
  "Makefile",
150
- "netlify.toml",
151
151
  "requirements-docs.txt",
152
152
  "requirements.txt",
153
153
 
@@ -3,7 +3,7 @@ from setuptools import find_packages
3
3
  from setuptools import setup
4
4
 
5
5
 
6
- version = "2.2.4"
6
+ version = "2.2.5"
7
7
 
8
8
  long_description = (
9
9
  f"{Path('README.md').read_text()}\n"
@@ -36,8 +36,8 @@ setup(
36
36
  "plone.app.uuid",
37
37
  "plone.app.dexterity",
38
38
  "plone.app.intid",
39
- "plone.app.layout",
40
39
  "plone.app.linkintegrity",
40
+ "plone.base",
41
41
  "plone.dexterity",
42
42
  "plone.i18n",
43
43
  "plone.registry",
@@ -133,7 +133,12 @@ def get(path=None, UID=None):
133
133
  relative_path=path,
134
134
  )
135
135
  try:
136
- content = site.restrictedTraverse(path)
136
+ path = path.split("/")
137
+ if len(path) > 1:
138
+ parent = site.unrestrictedTraverse(path[:-1])
139
+ content = parent.restrictedTraverse(path[-1])
140
+ else:
141
+ content = site.restrictedTraverse(path[-1])
137
142
  except (KeyError, AttributeError):
138
143
  return None # When no object is found don't raise an error
139
144
  else:
@@ -7,7 +7,7 @@ from logging import getLogger
7
7
  from plone.api.exc import CannotGetPortalError
8
8
  from plone.api.exc import InvalidParameterError
9
9
  from plone.api.validation import required_parameters
10
- from plone.app.layout.navigation.root import getNavigationRootObject
10
+ from plone.base.navigationroot import get_navigation_root_object
11
11
  from plone.registry.interfaces import IRegistry
12
12
  from Products.CMFCore.interfaces import ISiteRoot
13
13
  from Products.CMFCore.utils import getToolByName
@@ -86,7 +86,7 @@ def get_navigation_root(context=None):
86
86
  :Example: :ref:`portal-get-navigation-root-example`
87
87
  """
88
88
  context = aq_inner(context)
89
- return getNavigationRootObject(context, get())
89
+ return get_navigation_root_object(context, get())
90
90
 
91
91
 
92
92
  @required_parameters("name")
@@ -10,8 +10,8 @@ from plone.api.validation import at_least_one_of
10
10
  from plone.api.validation import required_parameters
11
11
  from plone.app.linkintegrity.handlers import modifiedContent
12
12
  from plone.app.linkintegrity.utils import referencedRelationship
13
+ from plone.base.utils import base_hasattr
13
14
  from plone.dexterity.utils import iterSchemataForType
14
- from Products.CMFPlone.utils import base_hasattr
15
15
  from z3c.relationfield import event
16
16
  from z3c.relationfield import RelationValue
17
17
  from z3c.relationfield.schema import Relation
@@ -14,7 +14,7 @@
14
14
  title="plone.api: Test fixture"
15
15
  description="Extension profile to configure a test fixture"
16
16
  provides="Products.GenericSetup.interfaces.EXTENSION"
17
- for="Products.CMFPlone.interfaces.ITestCasePloneSiteRoot"
17
+ for="plone.base.interfaces.ITestCasePloneSiteRoot"
18
18
  directory="profiles/testfixture"
19
19
  />
20
20
 
@@ -45,7 +45,7 @@ Assuming there is a document `english_page` in a folder `en`, which is the navig
45
45
  % invisible-code-block: python
46
46
  %
47
47
  % from plone import api
48
- % from plone.app.layout.navigation.interfaces import INavigationRoot
48
+ % from plone.base.interfaces import INavigationRoot
49
49
  % from zope.interface import alsoProvides
50
50
  %
51
51
  % portal = api.portal.get()
@@ -8,9 +8,9 @@ from plone import api
8
8
  from plone.api.content import _parse_object_provides_query
9
9
  from plone.api.tests.base import INTEGRATION_TESTING
10
10
  from plone.app.contenttypes.interfaces import IFolder
11
- from plone.app.layout.navigation.interfaces import INavigationRoot
12
11
  from plone.app.linkintegrity.exceptions import LinkIntegrityNotificationException
13
12
  from plone.app.textfield import RichTextValue
13
+ from plone.base.interfaces import INavigationRoot
14
14
  from plone.indexer import indexer
15
15
  from plone.uuid.interfaces import IMutableUUID
16
16
  from plone.uuid.interfaces import IUUIDGenerator
@@ -192,7 +192,7 @@ class TestPloneApiContent(unittest.TestCase):
192
192
  folder.setConstrainTypesMode(ENABLED)
193
193
  folder.setLocallyAllowedTypes(("News Item",))
194
194
  else: # DX
195
- from Products.CMFPlone.interfaces import ISelectableConstrainTypes
195
+ from plone.base.interfaces import ISelectableConstrainTypes
196
196
 
197
197
  constraints = ISelectableConstrainTypes(folder)
198
198
  constraints.setConstrainTypesMode(ENABLED)
@@ -478,6 +478,16 @@ class TestPloneApiContent(unittest.TestCase):
478
478
  # title is an attribute
479
479
  self.assertIsNone(api.content.get("/about/team/title"))
480
480
 
481
+ def test_get_of_content_in_inaccessible_container(self):
482
+ """Test getting items in a inaccessible container.
483
+ Worked in Plone 5.1 but raised Unauthorized since 5.2."""
484
+ api.content.transition(obj=self.team, transition="publish")
485
+ with api.env.adopt_roles(["Member"]):
486
+ team_by_path = api.content.get("/about/team")
487
+ self.assertEqual(self.team, team_by_path)
488
+ team_by_uid = api.content.get(UID=self.team.UID())
489
+ self.assertEqual(self.team, team_by_uid)
490
+
481
491
  def test_move_constraints(self):
482
492
  """Test the constraints for moving content."""
483
493
  from plone.api.exc import MissingParameterError
@@ -7,7 +7,7 @@ from plone.api import content
7
7
  from plone.api import env
8
8
  from plone.api import portal
9
9
  from plone.api.tests.base import INTEGRATION_TESTING
10
- from plone.app.layout.navigation.interfaces import INavigationRoot
10
+ from plone.base.interfaces import INavigationRoot
11
11
  from plone.registry import field
12
12
  from plone.registry.interfaces import IRegistry
13
13
  from plone.registry.record import Record
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: plone.api
3
- Version: 2.2.4
3
+ Version: 2.2.5
4
4
  Summary: A Plone API.
5
5
  Home-page: https://github.com/plone/plone.api
6
6
  Author: Plone Foundation
@@ -34,8 +34,8 @@ Requires-Dist: decorator
34
34
  Requires-Dist: plone.app.uuid
35
35
  Requires-Dist: plone.app.dexterity
36
36
  Requires-Dist: plone.app.intid
37
- Requires-Dist: plone.app.layout
38
37
  Requires-Dist: plone.app.linkintegrity
38
+ Requires-Dist: plone.base
39
39
  Requires-Dist: plone.dexterity
40
40
  Requires-Dist: plone.i18n
41
41
  Requires-Dist: plone.registry
@@ -110,6 +110,29 @@ Changelog
110
110
 
111
111
  .. towncrier release notes start
112
112
 
113
+ 2.2.5 (2025-01-24)
114
+ ------------------
115
+
116
+ Bug fixes:
117
+
118
+
119
+ - Fix api.content.get(path=path) when a item in the path is not accessible to the user.
120
+ [pbauer] (#549)
121
+ - Fix DeprecationWarnings. [maurits] (#4090)
122
+
123
+
124
+ Documentation:
125
+
126
+
127
+ - Preview docs on Read the Docs instead of Netlify. @stevepiercy (#545)
128
+ - Remove Netlify stuff, follow up to #545. @stevepiercy
129
+ - Sort and remove duplicate entries in `pyproject.toml`
130
+ - Remove unused docs requirements.
131
+ - Fix comments and remove unnecessary steps from `tox.ini`.
132
+ - Enable copy button for code blocks.
133
+ - Add linkcheck to documentation of documentation. (#546)
134
+
135
+
113
136
  2.2.4 (2024-12-16)
114
137
  ------------------
115
138
 
@@ -5,8 +5,8 @@ decorator
5
5
  plone.app.uuid
6
6
  plone.app.dexterity
7
7
  plone.app.intid
8
- plone.app.layout
9
8
  plone.app.linkintegrity
9
+ plone.base
10
10
  plone.dexterity
11
11
  plone.i18n
12
12
  plone.registry
@@ -255,7 +255,7 @@ allowlist_externals =
255
255
  echo
256
256
 
257
257
  [testenv:plone6docs]
258
- # New docs with sphinx-book-theme
258
+ # New docs with plone-sphinx-theme
259
259
  # See [testenv:docs] for classic documentation
260
260
  basepython = python3.11
261
261
  skip_install = False
@@ -271,6 +271,18 @@ commands =
271
271
  mkdir -p {toxinidir}/_build/plone6docs
272
272
  sphinx-build -b html -d _build/plone6docs/doctrees docs _build/plone6docs/html
273
273
 
274
+ [testenv:rtd-preview]
275
+ # Build docs on Read the Docs to preview pull requests using plone-sphinx-theme
276
+ basepython = python3.11
277
+ skip_install = False
278
+ extras =
279
+ tests
280
+ deps =
281
+ -r requirements-docs.txt
282
+ commands =
283
+ python -VV
284
+ sphinx-build -b html -d "{env:READTHEDOCS_OUTPUT}"/doctrees/ docs "{env:READTHEDOCS_OUTPUT}"/html/
285
+
274
286
  [testenv:docs]
275
287
  basepython = python3.9
276
288
  skip_install = False
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes