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

feat(api): add additional parameter to project/group iteration search#2796

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletionsdocs/gl_objects/iterations.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -31,3 +31,13 @@ List iterations for a project's ancestor groups::
List iterations for a group::

iterations = group.iterations.list()

Unavailable filters or keyword conflicts::

In case you are trying to pass a parameter that collides with a python
keyword (i.e. `in`) or with python-gitlab's internal arguments, you'll have
to use the `query_parameters` argument:

```
group.iterations.list(query_parameters={"in": "title"})
```
31 changes: 29 additions & 2 deletionsgitlab/v4/objects/iterations.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
from gitlab import types
from gitlab.base import RESTManager, RESTObject
from gitlab.mixins import ListMixin

Expand All@@ -16,11 +17,37 @@ class GroupIterationManager(ListMixin, RESTManager):
_path = "/groups/{group_id}/iterations"
_obj_cls = GroupIteration
_from_parent_attrs = {"group_id": "id"}
_list_filters = ("state", "search", "include_ancestors")
# When using the API, the "in" keyword collides with python's "in" keyword
# raising a SyntaxError.
# For this reason, we have to use the query_parameters argument:
# group.iterations.list(query_parameters={"in": "title"})
_list_filters = (
"include_ancestors",
"include_descendants",
"in",
"search",
"state",
"updated_after",
"updated_before",
)
_types = {"in": types.ArrayAttribute}


class ProjectIterationManager(ListMixin, RESTManager):
_path = "/projects/{project_id}/iterations"
_obj_cls = GroupIteration
_from_parent_attrs = {"project_id": "id"}
_list_filters = ("state", "search", "include_ancestors")
# When using the API, the "in" keyword collides with python's "in" keyword
# raising a SyntaxError.
# For this reason, we have to use the query_parameters argument:
# project.iterations.list(query_parameters={"in": "title"})
_list_filters = (
"include_ancestors",
"include_descendants",
"in",
"search",
"state",
"updated_after",
"updated_before",
)
_types = {"in": types.ArrayAttribute}

[8]ページ先頭

©2009-2025 Movatter.jp