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
Merged
Show file tree
Hide file tree
Changes from all 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 deletions 10 docs/gl_objects/iterations.rst
Original file line number Diff line number Diff 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 deletions 31 gitlab/v4/objects/iterations.py
Original file line number Diff line number Diff 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",
cristianocasella marked this conversation as resolved.
Show resolved Hide resolved
"in",
"search",
"state",
"updated_after",
"updated_before",
)
cristianocasella marked this conversation as resolved.
Show resolved Hide resolved
_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",
cristianocasella marked this conversation as resolved.
Show resolved Hide resolved
"in",
"search",
"state",
"updated_after",
"updated_before",
)
cristianocasella marked this conversation as resolved.
Show resolved Hide resolved
_types = {"in": types.ArrayAttribute}
Morty Proxy This is a proxified and sanitized view of the page, visit original site.