Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commitfd1f8fb

Browse files
author
Cristiano Casella
committed
feat: Added additional parameter to project/group iteration search
1 parente923542 commitfd1f8fb

File tree

2 files changed

+36
-2
lines changed

2 files changed

+36
-2
lines changed

‎docs/gl_objects/iterations.rst

Lines changed: 10 additions & 0 deletions
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 filters 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+
```

‎gitlab/v4/objects/iterations.py

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,35 @@ class GroupIterationManager(ListMixin, RESTManager):
1616
_path="/groups/{group_id}/iterations"
1717
_obj_cls=GroupIteration
1818
_from_parent_attrs= {"group_id":"id"}
19-
_list_filters= ("state","search","in","include_ancestors")
19+
# When using the API, the "in" keyword collides with python's "in" keyword
20+
# raising a SyntaxError.
21+
# For this reason, we have to use the query_parameters argument:
22+
# group.iterations.list(query_parameters={"in": "title"})
23+
_list_filters= (
24+
"include_ancestors",
25+
"include_descendants",
26+
"in",
27+
"search",
28+
"state",
29+
"updated_after",
30+
"updated_before",
31+
)
2032

2133

2234
classProjectIterationManager(ListMixin,RESTManager):
2335
_path="/projects/{project_id}/iterations"
2436
_obj_cls=GroupIteration
2537
_from_parent_attrs= {"project_id":"id"}
26-
_list_filters= ("state","search","in","include_ancestors")
38+
# When using the API, the "in" keyword collides with python's "in" keyword
39+
# raising a SyntaxError.
40+
# For this reason, we have to use the query_parameters argument:
41+
# group.iterations.list(query_parameters={"in": "title"})
42+
_list_filters= (
43+
"include_ancestors",
44+
"include_descendants",
45+
"in",
46+
"search",
47+
"state",
48+
"updated_after",
49+
"updated_before",
50+
)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp