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

Commitf4c4e52

Browse files
author
Gauvain Pocentek
committed
Add support for board creation/deletion (EE)
1 parentd6a61af commitf4c4e52

File tree

3 files changed

+37
-9
lines changed

3 files changed

+37
-9
lines changed

‎docs/gl_objects/boards.rst

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,25 @@ Examples
3232
Get the list of existing boards for a project or a group::
3333

3434
# item is a Project or a Group
35-
boards =item.boards.list()
35+
boards =project_or_group.boards.list()
3636

3737
Get a single board for a project or a group::
3838

39-
board =group.boards.get(board_id)
39+
board =project_or_group.boards.get(board_id)
4040

41-
..note::
41+
Create a board::
4242

43-
Boards cannot be created using the API, they need to be created using the
44-
UI.
43+
board = project_or_group.boards.create({'name': 'new-board'})
44+
45+
..note::Board creation is not supported in the GitLab CE edition.
46+
47+
Delete a board::
48+
49+
board.delete()
50+
# or
51+
project_or_group.boards.delete(board_id)
52+
53+
..note::Board deletion is not supported in the GitLab CE edition.
4554

4655
Board lists
4756
===========

‎gitlab/v4/objects.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -580,14 +580,15 @@ class GroupBoardListManager(CRUDMixin, RESTManager):
580580
_update_attrs= (('position', ),tuple())
581581

582582

583-
classGroupBoard(RESTObject):
583+
classGroupBoard(ObjectDeleteMixin,RESTObject):
584584
_managers= (('lists','GroupBoardListManager'), )
585585

586586

587-
classGroupBoardManager(RetrieveMixin,RESTManager):
587+
classGroupBoardManager(NoUpdateMixin,RESTManager):
588588
_path='/groups/%(group_id)s/boards'
589589
_obj_cls=GroupBoard
590590
_from_parent_attrs= {'group_id':'id'}
591+
_create_attrs= (('name', ),tuple())
591592

592593

593594
classGroupCustomAttribute(ObjectDeleteMixin,RESTObject):
@@ -1004,14 +1005,15 @@ class ProjectBoardListManager(CRUDMixin, RESTManager):
10041005
_update_attrs= (('position', ),tuple())
10051006

10061007

1007-
classProjectBoard(RESTObject):
1008+
classProjectBoard(ObjectDeleteMixin,RESTObject):
10081009
_managers= (('lists','ProjectBoardListManager'), )
10091010

10101011

1011-
classProjectBoardManager(RetrieveMixin,RESTManager):
1012+
classProjectBoardManager(NoUpdateMixin,RESTManager):
10121013
_path='/projects/%(project_id)s/boards'
10131014
_obj_cls=ProjectBoard
10141015
_from_parent_attrs= {'project_id':'id'}
1016+
_create_attrs= (('name', ),tuple())
10151017

10161018

10171019
classProjectBranch(ObjectDeleteMixin,RESTObject):

‎tools/ee-test.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,20 @@ def end_log():
6666
group1.ldap_sync()
6767
group1.delete_ldap_group_link(LDAP_CN)
6868
end_log()
69+
70+
start_log('Boards')
71+
# bit of cleanup just in case
72+
forboardinproject1.boards.list():
73+
ifboard.name=='testboard':
74+
board.delete()
75+
board=project1.boards.create({'name':'testboard'})
76+
board=project1.boards.get(board.id)
77+
project1.boards.delete(board.id)
78+
79+
forboardingroup1.boards.list():
80+
ifboard.name=='testboard':
81+
board.delete()
82+
board=group1.boards.create({'name':'testboard'})
83+
board=group1.boards.get(board.id)
84+
group1.boards.delete(board.id)
85+
end_log()

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp