Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 623dac9

Browse filesBrowse files
cristianocasellaCristiano Casellanejch
authored
feat(api): add additional parameter to project/group iteration search (#2796)
Co-authored-by: Cristiano Casella <cristiano.casella@seacom.it> Co-authored-by: Nejc Habjan <hab.nejc@gmail.com>
1 parent d569128 commit 623dac9
Copy full SHA for 623dac9

File tree

Expand file treeCollapse file tree

2 files changed

+39
-2
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+39
-2
lines changed
Open diff view settings
Collapse file

‎docs/gl_objects/iterations.rst‎

Copy file name to clipboardExpand all lines: docs/gl_objects/iterations.rst
+10Lines changed: 10 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,13 @@ List iterations for a project's ancestor groups::
3131
List iterations for a group::
3232

3333
iterations = group.iterations.list()
34+
35+
Unavailable filters or keyword conflicts::
36+
37+
In case you are trying to pass a parameter that collides with a python
38+
keyword (i.e. `in`) or with python-gitlab's internal arguments, you'll have
39+
to use the `query_parameters` argument:
40+
41+
```
42+
group.iterations.list(query_parameters={"in": "title"})
43+
```
Collapse file

‎gitlab/v4/objects/iterations.py‎

Copy file name to clipboardExpand all lines: gitlab/v4/objects/iterations.py
+29-2Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from gitlab import types
12
from gitlab.base import RESTManager, RESTObject
23
from gitlab.mixins import ListMixin
34

@@ -16,11 +17,37 @@ class GroupIterationManager(ListMixin, RESTManager):
1617
_path = "/groups/{group_id}/iterations"
1718
_obj_cls = GroupIteration
1819
_from_parent_attrs = {"group_id": "id"}
19-
_list_filters = ("state", "search", "include_ancestors")
20+
# When using the API, the "in" keyword collides with python's "in" keyword
21+
# raising a SyntaxError.
22+
# For this reason, we have to use the query_parameters argument:
23+
# group.iterations.list(query_parameters={"in": "title"})
24+
_list_filters = (
25+
"include_ancestors",
26+
"include_descendants",
27+
"in",
28+
"search",
29+
"state",
30+
"updated_after",
31+
"updated_before",
32+
)
33+
_types = {"in": types.ArrayAttribute}
2034

2135

2236
class ProjectIterationManager(ListMixin, RESTManager):
2337
_path = "/projects/{project_id}/iterations"
2438
_obj_cls = GroupIteration
2539
_from_parent_attrs = {"project_id": "id"}
26-
_list_filters = ("state", "search", "include_ancestors")
40+
# When using the API, the "in" keyword collides with python's "in" keyword
41+
# raising a SyntaxError.
42+
# For this reason, we have to use the query_parameters argument:
43+
# project.iterations.list(query_parameters={"in": "title"})
44+
_list_filters = (
45+
"include_ancestors",
46+
"include_descendants",
47+
"in",
48+
"search",
49+
"state",
50+
"updated_after",
51+
"updated_before",
52+
)
53+
_types = {"in": types.ArrayAttribute}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.