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

Commit8c9ad29

Browse files
author
Gauvain Pocentek
committed
Change ProjectUser and GroupProject base class
python-gitlab shouldn't try to provide features that are not existing inthe Gitlab API: GroupProject and ProjectUser objects should not provideunsupported API methods (no get, no create, no update).ThisCloses#346 by making explicit that we don't support thesenon-existant methods.
1 parent32ea62a commit8c9ad29

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed

‎RELEASE_NOTES.rst

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,25 @@ Release notes
44

55
This page describes important changes between python-gitlab releases.
66

7+
Changes from 1.0.2 to 1.1
8+
=========================
9+
10+
* The ``ProjectUser`` class doesn't inherit from ``User`` anymore, and the
11+
``GroupProject`` class doesn't inherit from ``Project`` anymore. The Gitlab
12+
API doesn't provide the same set of features for these objects, so
13+
python-gitlab objects shouldn't try to workaround that.
14+
15+
You can create ``User`` or ``Project`` objects from ``ProjectUser`` and
16+
``GroupProject`` objects using the ``id`` attribute:
17+
18+
..code-block::python
19+
20+
for gr_projectin group.projects.list():
21+
# lazy object creation doesn't need an Gitlab API request
22+
project= gl.projects.get(gr_project.id,lazy=True)
23+
project.default_branch='develop'
24+
project.save()
25+
726
Changes from 0.21 to 1.0.0
827
==========================
928

‎gitlab/v4/objects.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1601,7 +1601,7 @@ class ProjectTriggerManager(CRUDMixin, RESTManager):
16011601
_update_attrs= (('description', ),tuple())
16021602

16031603

1604-
classProjectUser(User):
1604+
classProjectUser(RESTObject):
16051605
pass
16061606

16071607

@@ -2244,7 +2244,7 @@ class ProjectManager(CRUDMixin, RESTManager):
22442244
'with_issues_enabled','with_merge_requests_enabled')
22452245

22462246

2247-
classGroupProject(Project):
2247+
classGroupProject(RESTObject):
22482248
pass
22492249

22502250

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp