Skip to content

Commit

Permalink
[fc] Repository: plone.app.querystring
Browse files Browse the repository at this point in the history
Branch: refs/heads/master
Date: 2023-09-19T13:34:08-07:00
Author: David Glick (davisagli) <david@glicksoftware.com>
Commit: plone/plone.app.querystring@51d91d7

Support getting querystring vocabs in context

Files changed:
M plone/app/querystring/registryreader.py
Repository: plone.app.querystring

Branch: refs/heads/master
Date: 2023-09-19T22:46:00-07:00
Author: David Glick (davisagli) <david@glicksoftware.com>
Commit: plone/plone.app.querystring@c88657c

changelog

Files changed:
A news/137.feature
Repository: plone.app.querystring

Branch: refs/heads/master
Date: 2023-09-20T12:19:18-07:00
Author: David Glick (davisagli) <david@glicksoftware.com>
Commit: plone/plone.app.querystring@118ad82

add test

Files changed:
M plone/app/querystring/tests/testRegistryReader.py
Repository: plone.app.querystring

Branch: refs/heads/master
Date: 2023-09-21T07:40:36-07:00
Author: David Glick (davisagli) <david@glicksoftware.com>
Commit: plone/plone.app.querystring@c2e7f3a

Merge pull request #137 from plone/contextual-vocabs

Support getting querystring vocabs in context

Files changed:
A news/137.feature
M plone/app/querystring/registryreader.py
M plone/app/querystring/tests/testRegistryReader.py
  • Loading branch information
davisagli committed Sep 21, 2023
1 parent 782a61d commit 8aaee5f
Showing 1 changed file with 56 additions and 7 deletions.
63 changes: 56 additions & 7 deletions last_commit.txt
@@ -1,15 +1,64 @@
Repository: plonetheme.barceloneta
Repository: plone.app.querystring


Branch: refs/heads/master
Date: 2023-09-21T15:08:07+02:00
Author: Peter Mathis (petschki) <petschki@users.noreply.github.com>
Commit: https://github.com/plone/plonetheme.barceloneta/commit/2647f3ae089a65616d7c744d95b6c1a8da9797fa
Date: 2023-09-19T13:34:08-07:00
Author: David Glick (davisagli) <david@glicksoftware.com>
Commit: https://github.com/plone/plone.app.querystring/commit/51d91d7444429d520d5368834c9984bbe9c449b6

typo in CHANGES
Support getting querystring vocabs in context

Files changed:
M CHANGES.md
M plone/app/querystring/registryreader.py

b'diff --git a/CHANGES.md b/CHANGES.md\nindex 3112e538..3620e42d 100644\n--- a/CHANGES.md\n+++ b/CHANGES.md\n@@ -14,7 +14,7 @@\n \n ### Bug fixes:\n \n-- Update Bootstrap to ``5.2.3``\n+- Update Bootstrap to ``5.3.2``\n [petschki] #346\n \n \n'
b'diff --git a/plone/app/querystring/registryreader.py b/plone/app/querystring/registryreader.py\nindex 5926a5f..ad6e23f 100644\n--- a/plone/app/querystring/registryreader.py\n+++ b/plone/app/querystring/registryreader.py\n@@ -42,6 +42,7 @@ def __init__(self, context, request=None):\n request = getRequest()\n \n self.context = context\n+ self.vocab_context = context\n self.request = request\n \n def parseRegistry(self):\n@@ -87,7 +88,7 @@ def getVocabularyValues(self, values):\n # Bail out if the annotation is marked not to fetch the vocabulary\n # to allow the widget to query the vocabulary as needed\n continue\n- for item in utility(self.context):\n+ for item in utility(self.vocab_context):\n if isinstance(item.title, Message):\n title = translate(item.title, context=self.request)\n else:\n'

Repository: plone.app.querystring


Branch: refs/heads/master
Date: 2023-09-19T22:46:00-07:00
Author: David Glick (davisagli) <david@glicksoftware.com>
Commit: https://github.com/plone/plone.app.querystring/commit/c88657c95c77d92a505f2affe771dfd929a53684

changelog

Files changed:
A news/137.feature

b'diff --git a/news/137.feature b/news/137.feature\nnew file mode 100644\nindex 0000000..17bac84\n--- /dev/null\n+++ b/news/137.feature\n@@ -0,0 +1 @@\n+Add a way to specific a context for getting vocabularies in the QuerystringRegistryReader. @davisagli\n'

Repository: plone.app.querystring


Branch: refs/heads/master
Date: 2023-09-20T12:19:18-07:00
Author: David Glick (davisagli) <david@glicksoftware.com>
Commit: https://github.com/plone/plone.app.querystring/commit/118ad82fefd7a7d2d1b31e31cdb6b012eb2e4dd2

add test

Files changed:
M plone/app/querystring/tests/testRegistryReader.py

b'diff --git a/plone/app/querystring/tests/testRegistryReader.py b/plone/app/querystring/tests/testRegistryReader.py\nindex f348bcd..962ad68 100644\n--- a/plone/app/querystring/tests/testRegistryReader.py\n+++ b/plone/app/querystring/tests/testRegistryReader.py\n@@ -15,7 +15,8 @@\n @implementer(IVocabularyFactory)\n class TestVocabulary:\n def __call__(self, context):\n- return SimpleVocabulary([SimpleVocabulary.createTerm("foo", "foo", "bar")])\n+ term = "subsite term" if getattr(context, "id", None) == "subsite" else "term"\n+ return SimpleVocabulary([SimpleVocabulary.createTerm(term, term, term)])\n \n \n class TestRegistryReader(unittest.TestCase):\n@@ -82,7 +83,19 @@ def test_get_vocabularies(self):\n result = reader.parseRegistry()\n result = reader.getVocabularyValues(result)\n vocabulary_result = result.get("plone.app.querystring.field.reviewState.values")\n- self.assertEqual(vocabulary_result, {"foo": {"title": "bar"}})\n+ self.assertEqual(vocabulary_result, {"term": {"title": "term"}})\n+\n+ def test_get_vocabularies_in_context(self):\n+ portal = self.layer["portal"]\n+ subsite = portal[portal.invokeFactory("Document", "subsite", title="Subsite")]\n+\n+ registry = self.createRegistry(td.test_vocabulary_xml)\n+ reader = IQuerystringRegistryReader(registry)\n+ reader.vocab_context = subsite\n+ result = reader.parseRegistry()\n+ result = reader.getVocabularyValues(result)\n+ vocabulary_result = result.get("plone.app.querystring.field.reviewState.values")\n+ self.assertEqual(vocabulary_result, {"subsite term": {"title": "subsite term"}})\n \n def test_map_operations_clean(self):\n """tests if mapOperations is getting all operators correctly"""\n'

Repository: plone.app.querystring


Branch: refs/heads/master
Date: 2023-09-21T07:40:36-07:00
Author: David Glick (davisagli) <david@glicksoftware.com>
Commit: https://github.com/plone/plone.app.querystring/commit/c2e7f3abb8b32f026d4ddd85b5122fbe0c2b21fa

Merge pull request #137 from plone/contextual-vocabs

Support getting querystring vocabs in context

Files changed:
A news/137.feature
M plone/app/querystring/registryreader.py
M plone/app/querystring/tests/testRegistryReader.py

b'diff --git a/news/137.feature b/news/137.feature\nnew file mode 100644\nindex 0000000..17bac84\n--- /dev/null\n+++ b/news/137.feature\n@@ -0,0 +1 @@\n+Add a way to specific a context for getting vocabularies in the QuerystringRegistryReader. @davisagli\ndiff --git a/plone/app/querystring/registryreader.py b/plone/app/querystring/registryreader.py\nindex 5926a5f..ad6e23f 100644\n--- a/plone/app/querystring/registryreader.py\n+++ b/plone/app/querystring/registryreader.py\n@@ -42,6 +42,7 @@ def __init__(self, context, request=None):\n request = getRequest()\n \n self.context = context\n+ self.vocab_context = context\n self.request = request\n \n def parseRegistry(self):\n@@ -87,7 +88,7 @@ def getVocabularyValues(self, values):\n # Bail out if the annotation is marked not to fetch the vocabulary\n # to allow the widget to query the vocabulary as needed\n continue\n- for item in utility(self.context):\n+ for item in utility(self.vocab_context):\n if isinstance(item.title, Message):\n title = translate(item.title, context=self.request)\n else:\ndiff --git a/plone/app/querystring/tests/testRegistryReader.py b/plone/app/querystring/tests/testRegistryReader.py\nindex f348bcd..962ad68 100644\n--- a/plone/app/querystring/tests/testRegistryReader.py\n+++ b/plone/app/querystring/tests/testRegistryReader.py\n@@ -15,7 +15,8 @@\n @implementer(IVocabularyFactory)\n class TestVocabulary:\n def __call__(self, context):\n- return SimpleVocabulary([SimpleVocabulary.createTerm("foo", "foo", "bar")])\n+ term = "subsite term" if getattr(context, "id", None) == "subsite" else "term"\n+ return SimpleVocabulary([SimpleVocabulary.createTerm(term, term, term)])\n \n \n class TestRegistryReader(unittest.TestCase):\n@@ -82,7 +83,19 @@ def test_get_vocabularies(self):\n result = reader.parseRegistry()\n result = reader.getVocabularyValues(result)\n vocabulary_result = result.get("plone.app.querystring.field.reviewState.values")\n- self.assertEqual(vocabulary_result, {"foo": {"title": "bar"}})\n+ self.assertEqual(vocabulary_result, {"term": {"title": "term"}})\n+\n+ def test_get_vocabularies_in_context(self):\n+ portal = self.layer["portal"]\n+ subsite = portal[portal.invokeFactory("Document", "subsite", title="Subsite")]\n+\n+ registry = self.createRegistry(td.test_vocabulary_xml)\n+ reader = IQuerystringRegistryReader(registry)\n+ reader.vocab_context = subsite\n+ result = reader.parseRegistry()\n+ result = reader.getVocabularyValues(result)\n+ vocabulary_result = result.get("plone.app.querystring.field.reviewState.values")\n+ self.assertEqual(vocabulary_result, {"subsite term": {"title": "subsite term"}})\n \n def test_map_operations_clean(self):\n """tests if mapOperations is getting all operators correctly"""\n'

0 comments on commit 8aaee5f

Please sign in to comment.