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: 2020-07-14T15:46:31+02:00
Author: Georg Gogo. BERNHARD (gogobd) <gogo@bluedynamics.com>
Commit: plone/plone.app.querystring@6ba125e

Issue #97 i.e. allow for MultiPath Queries (#98)

Changes for bugfix #97 - making PATH_INDICES dynamic

Files changed:
A news/97.bugfix
M plone/app/querystring/queryparser.py
  • Loading branch information
jensens committed Jul 14, 2020
1 parent a1268db commit d9a0fc9
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions last_commit.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
Repository: plone.formwidget.namedfile
Repository: plone.app.querystring


Branch: refs/heads/master
Date: 2020-07-14T10:02:05+02:00
Author: Vincent Fretin (vincentfretin) <vincent.fretin@gmail.com>
Commit: https://github.com/plone/plone.formwidget.namedfile/commit/1189d0e0349bb5251a26491b4bd6feb096f84a3c
Date: 2020-07-14T15:46:31+02:00
Author: Georg Gogo. BERNHARD (gogobd) <gogo@bluedynamics.com>
Commit: https://github.com/plone/plone.app.querystring/commit/6ba125e57eb1b571352325038fcda9f1f3b765fd

fix syntax error in changelog
Issue #97 i.e. allow for MultiPath Queries (#98)

Changes for bugfix #97 - making PATH_INDICES dynamic

Files changed:
M CHANGES.rst
A news/97.bugfix
M plone/app/querystring/queryparser.py

b'diff --git a/CHANGES.rst b/CHANGES.rst\nindex cf5f0cc..cb753c1 100644\n--- a/CHANGES.rst\n+++ b/CHANGES.rst\n@@ -14,8 +14,8 @@ Changelog\n New features:\n \n \n-- - Range support (https://developer.mozilla.org/en-US/docs/Web/HTTP/Range_requests)\n- [mamico] (#44)\n+- Range support (https://developer.mozilla.org/en-US/docs/Web/HTTP/Range_requests)\n+ [mamico] (#44)\n \n \n 2.0.11 (2020-04-20)\n'
b'diff --git a/news/97.bugfix b/news/97.bugfix\nnew file mode 100644\nindex 0000000..955f8f5\n--- /dev/null\n+++ b/news/97.bugfix\n@@ -0,0 +1 @@\n+Fixing issue #97: Multiple path support for Translation Groups, using PATH_INDICES as suggested by jensens\ndiff --git a/plone/app/querystring/queryparser.py b/plone/app/querystring/queryparser.py\nindex 1f28824..55124d7 100644\n--- a/plone/app/querystring/queryparser.py\n+++ b/plone/app/querystring/queryparser.py\n@@ -14,6 +14,7 @@\n \n \n Row = namedtuple(\'Row\', [\'index\', \'operator\', \'values\'])\n+PATH_INDICES = {\'path\'}\n \n \n def parseFormquery(context, formquery, sort_on=None, sort_order=None):\n@@ -41,8 +42,15 @@ def parseFormquery(context, formquery, sort_on=None, sort_order=None):\n kwargs = parser(context, row)\n \n # Special path handling - since multipath queries are possible\n- if \'path\' in query and \'path\' in kwargs:\n- query[\'path\'][\'query\'].extend(kwargs[\'path\'][\'query\'])\n+ path_index = PATH_INDICES & set(kwargs)\n+ if len(path_index) == 1:\n+ path_index = list(path_index)[0]\n+ if path_index in query:\n+ query[path_index][\'query\'].extend(kwargs[path_index][\'query\'])\n+ else:\n+ query.update(kwargs)\n+ elif len(path_index) > 1:\n+ raise IndexError("Too many path indices in one row.")\n else:\n query.update(kwargs)\n \n'

0 comments on commit d9a0fc9

Please sign in to comment.