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

Commit979053c

Browse files
fix: add support forprojects.groups.*
Add support for `projects.groups.*` endpoints.Required re-arranging the code to prevent circular imports.
1 parent8d4c953 commit979053c

File tree

2 files changed

+32
-31
lines changed

2 files changed

+32
-31
lines changed

‎gitlab/v4/objects/groups.py‎

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,22 +30,50 @@
3030
from .milestonesimportGroupMilestoneManager# noqa: F401
3131
from .notification_settingsimportGroupNotificationSettingsManager# noqa: F401
3232
from .packagesimportGroupPackageManager# noqa: F401
33-
from .projectsimportGroupProjectManager# noqa: F401
3433
from .runnersimportGroupRunnerManager# noqa: F401
3534
from .statisticsimportGroupIssuesStatisticsManager# noqa: F401
3635
from .variablesimportGroupVariableManager# noqa: F401
3736
from .wikisimportGroupWikiManager# noqa: F401
3837

3938
__all__= [
4039
"Group",
41-
"GroupManager",
4240
"GroupDescendantGroup",
4341
"GroupDescendantGroupManager",
42+
"GroupManager",
43+
"GroupProject",
44+
"GroupProjectManager",
4445
"GroupSubgroup",
4546
"GroupSubgroupManager",
4647
]
4748

4849

50+
classGroupProject(RESTObject):
51+
pass
52+
53+
54+
classGroupProjectManager(ListMixin,RESTManager):
55+
_path="/groups/{group_id}/projects"
56+
_obj_cls=GroupProject
57+
_from_parent_attrs= {"group_id":"id"}
58+
_list_filters= (
59+
"archived",
60+
"visibility",
61+
"order_by",
62+
"sort",
63+
"search",
64+
"simple",
65+
"owned",
66+
"starred",
67+
"with_custom_attributes",
68+
"include_subgroups",
69+
"with_issues_enabled",
70+
"with_merge_requests_enabled",
71+
"with_shared",
72+
"min_access_level",
73+
"with_security_reports",
74+
)
75+
76+
4977
classGroup(SaveMixin,ObjectDeleteMixin,RESTObject):
5078
_short_print_attr="name"
5179

‎gitlab/v4/objects/projects.py‎

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
from .eventsimportProjectEventManager# noqa: F401
3333
from .export_importimportProjectExportManager,ProjectImportManager# noqa: F401
3434
from .filesimportProjectFileManager# noqa: F401
35+
from .groupsimportGroupManager# noqa: F401
3536
from .hooksimportProjectHookManager# noqa: F401
3637
from .issuesimportProjectIssueManager# noqa: F401
3738
from .jobsimportProjectJobManager# noqa: F401
@@ -71,8 +72,6 @@
7172
from .wikisimportProjectWikiManager# noqa: F401
7273

7374
__all__= [
74-
"GroupProject",
75-
"GroupProjectManager",
7675
"Project",
7776
"ProjectManager",
7877
"ProjectFork",
@@ -82,33 +81,6 @@
8281
]
8382

8483

85-
classGroupProject(RESTObject):
86-
pass
87-
88-
89-
classGroupProjectManager(ListMixin,RESTManager):
90-
_path="/groups/{group_id}/projects"
91-
_obj_cls=GroupProject
92-
_from_parent_attrs= {"group_id":"id"}
93-
_list_filters= (
94-
"archived",
95-
"visibility",
96-
"order_by",
97-
"sort",
98-
"search",
99-
"simple",
100-
"owned",
101-
"starred",
102-
"with_custom_attributes",
103-
"include_subgroups",
104-
"with_issues_enabled",
105-
"with_merge_requests_enabled",
106-
"with_shared",
107-
"min_access_level",
108-
"with_security_reports",
109-
)
110-
111-
11284
classProject(RefreshMixin,SaveMixin,ObjectDeleteMixin,RepositoryMixin,RESTObject):
11385
_short_print_attr="path"
11486

@@ -132,6 +104,7 @@ class Project(RefreshMixin, SaveMixin, ObjectDeleteMixin, RepositoryMixin, RESTO
132104
files:ProjectFileManager
133105
forks:"ProjectForkManager"
134106
generic_packages:GenericPackageManager
107+
groups:GroupManager
135108
hooks:ProjectHookManager
136109
imports:ProjectImportManager
137110
issues:ProjectIssueManager

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp