| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -31,3 +31,13 @@ List iterations for a project's ancestor groups:: | |||
| 31 | 31 | List iterations for a group:: | |
| 32 | 32 | ||
| 33 | 33 | 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 | + ``` | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,3 +1,4 @@ | |||
| 1 | + from gitlab import types | ||
| 1 | 2 | from gitlab.base import RESTManager, RESTObject | |
| 2 | 3 | from gitlab.mixins import ListMixin | |
| 3 | 4 | ||
@@ -16,11 +17,37 @@ class GroupIterationManager(ListMixin, RESTManager): | |||
| 16 | 17 | _path = "/groups/{group_id}/iterations" | |
| 17 | 18 | _obj_cls = GroupIteration | |
| 18 | 19 | _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} | ||
| 20 | 34 | ||
| 21 | 35 | ||
| 22 | 36 | class ProjectIterationManager(ListMixin, RESTManager): | |
| 23 | 37 | _path = "/projects/{project_id}/iterations" | |
| 24 | 38 | _obj_cls = GroupIteration | |
| 25 | 39 | _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} | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments