diff options
Diffstat (limited to 'gitlab')
-rw-r--r-- | gitlab/mixins.py | 9 | ||||
-rw-r--r-- | gitlab/v4/objects.py | 7 |
2 files changed, 12 insertions, 4 deletions
diff --git a/gitlab/mixins.py b/gitlab/mixins.py index 88fea2d..d3e5727 100644 --- a/gitlab/mixins.py +++ b/gitlab/mixins.py @@ -15,6 +15,8 @@ # You should have received a copy of the GNU Lesser General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. +import warnings + import gitlab from gitlab import base from gitlab import cli @@ -130,9 +132,13 @@ class ListMixin(object): class GetFromListMixin(ListMixin): + """This mixin is deprecated.""" + def get(self, id, **kwargs): """Retrieve a single object. + This Method is deprecated. + Args: id (int or str): ID of the object to retrieve **kwargs: Extra options to send to the Gitlab server (e.g. sudo) @@ -144,6 +150,9 @@ class GetFromListMixin(ListMixin): GitlabAuthenticationError: If authentication is not correct GitlabGetError: If the server cannot perform the request """ + warnings.warn('The get() method for this object is deprecated ' + 'and will be removed in a future version.', + DeprecationWarning) try: gen = self.list() except exc.GitlabListError: diff --git a/gitlab/v4/objects.py b/gitlab/v4/objects.py index 1cb8fe7..0e28f5c 100644 --- a/gitlab/v4/objects.py +++ b/gitlab/v4/objects.py @@ -547,8 +547,7 @@ class GroupMember(SaveMixin, ObjectDeleteMixin, RESTObject): _short_print_attr = 'username' -class GroupMemberManager(ListMixin, GetMixin, CreateMixin, UpdateMixin, - DeleteMixin, RESTManager): +class GroupMemberManager(CRUDMixin, RESTManager): _path = '/groups/%(group_id)s/members' _obj_cls = GroupMember _from_parent_attrs = {'group_id': 'id'} @@ -822,7 +821,7 @@ class Namespace(RESTObject): pass -class NamespaceManager(GetFromListMixin, RESTManager): +class NamespaceManager(RetrieveMixin, RESTManager): _path = '/namespaces' _obj_cls = Namespace _list_filters = ('search', ) @@ -854,7 +853,7 @@ class ProjectBoard(RESTObject): _managers = (('lists', 'ProjectBoardListManager'), ) -class ProjectBoardManager(GetFromListMixin, RESTManager): +class ProjectBoardManager(RetrieveMixin, RESTManager): _path = '/projects/%(project_id)s/boards' _obj_cls = ProjectBoard _from_parent_attrs = {'project_id': 'id'} |