@@ -638,7 +638,6 @@ class ProjectBranch(GitlabObject):
638638 canUpdate = False
639639 requiredUrlAttrs = ['project_id' ]
640640 requiredCreateAttrs = ['branch_name' , 'ref' ]
641- _constructorTypes = {'commit' : 'ProjectCommit' }
642641
643642 def protect (self , protect = True , ** kwargs ):
644643 url = self ._url % {'project_id' : self .project_id }
@@ -832,8 +831,23 @@ class ProjectNoteManager(BaseManager):
832831 obj_cls = ProjectNote
833832
834833
834+ class ProjectTagRelease (GitlabObject ):
835+ _url = '/projects/%(project_id)s/repository/tags/%(tag_name)/release'
836+ canDelete = False
837+ canList = False
838+ requiredUrlAttrs = ['project_id' , 'tag_name' ]
839+ requiredCreateAttrs = ['description' ]
840+ shortPrintAttr = 'description'
841+
842+
843+ class ProjectTagReleaseManager (BaseManager ):
844+ obj_cls = ProjectTagRelease
845+
846+
835847class ProjectTag (GitlabObject ):
836848 _url = '/projects/%(project_id)s/repository/tags'
849+ _constructorTypes = {'release' : 'ProjectTagRelease' ,
850+ 'commit' : 'ProjectCommit' }
837851 idAttr = 'name'
838852 canGet = 'from_list'
839853 canUpdate = False
@@ -842,6 +856,17 @@ class ProjectTag(GitlabObject):
842856 optionalCreateAttrs = ['message' ]
843857 shortPrintAttr = 'name'
844858
859+ def set_release_description (self , description ):
860+ url = '/projects/%s/repository/tags/%s/release' % (self .project_id ,
861+ self .name )
862+ if self .release is None :
863+ r = self .gitlab ._raw_post (url , data = {'description' : description })
864+ raise_error_from_response (r , GitlabCreateError , 201 )
865+ else :
866+ r = self .gitlab ._raw_put (url , data = {'description' : description })
867+ raise_error_from_response (r , GitlabUpdateError , 200 )
868+ self .release = ProjectTagRelease (self , r .json ())
869+
845870
846871class ProjectTagManager (BaseManager ):
847872 obj_cls = ProjectTag
0 commit comments