From d8de4dc373dc608be6cf6ba14a2acc7efd3fa7a7 Mon Sep 17 00:00:00 2001 From: "John L. Villalovos" Date: Sun, 13 Jun 2021 14:40:46 -0700 Subject: chore: convert to using type-annotations for managers Convert our manager usage to be done via type annotations. Now to define a manager to be used in a RESTObject subclass can simply do: class ExampleClass(CRUDMixin, RESTObject): my_manager: MyManager Any type-annotation that annotates it to be of type *Manager (with the exception of RESTManager) will cause the manager to be created on the object. --- gitlab/v4/objects/discussions.py | 4 ---- 1 file changed, 4 deletions(-) (limited to 'gitlab/v4/objects/discussions.py') diff --git a/gitlab/v4/objects/discussions.py b/gitlab/v4/objects/discussions.py index 19d1a06..ae7a4d5 100644 --- a/gitlab/v4/objects/discussions.py +++ b/gitlab/v4/objects/discussions.py @@ -22,7 +22,6 @@ __all__ = [ class ProjectCommitDiscussion(RESTObject): notes: ProjectCommitDiscussionNoteManager - _managers = (("notes", "ProjectCommitDiscussionNoteManager"),) class ProjectCommitDiscussionManager(RetrieveMixin, CreateMixin, RESTManager): @@ -34,7 +33,6 @@ class ProjectCommitDiscussionManager(RetrieveMixin, CreateMixin, RESTManager): class ProjectIssueDiscussion(RESTObject): notes: ProjectIssueDiscussionNoteManager - _managers = (("notes", "ProjectIssueDiscussionNoteManager"),) class ProjectIssueDiscussionManager(RetrieveMixin, CreateMixin, RESTManager): @@ -46,7 +44,6 @@ class ProjectIssueDiscussionManager(RetrieveMixin, CreateMixin, RESTManager): class ProjectMergeRequestDiscussion(SaveMixin, RESTObject): notes: ProjectMergeRequestDiscussionNoteManager - _managers = (("notes", "ProjectMergeRequestDiscussionNoteManager"),) class ProjectMergeRequestDiscussionManager( @@ -63,7 +60,6 @@ class ProjectMergeRequestDiscussionManager( class ProjectSnippetDiscussion(RESTObject): notes: ProjectSnippetDiscussionNoteManager - _managers = (("notes", "ProjectSnippetDiscussionNoteManager"),) class ProjectSnippetDiscussionManager(RetrieveMixin, CreateMixin, RESTManager): -- cgit v1.2.1