diff options
-rw-r--r-- | RELEASE_NOTES.rst | 19 | ||||
-rw-r--r-- | gitlab/objects.py | 6 |
2 files changed, 24 insertions, 1 deletions
diff --git a/RELEASE_NOTES.rst b/RELEASE_NOTES.rst new file mode 100644 index 0000000..669e00e --- /dev/null +++ b/RELEASE_NOTES.rst @@ -0,0 +1,19 @@ +############################### +Release notes for python-gitlab +############################### + +This page describes important changes between python-gitlab releases. + +Changes from 0.19 to 0.20 +========================= + +* The ``projects`` attribute of ``Group`` objects is not a list of ``Project`` + objects anymore. It is a Manager object giving access to ``GroupProject`` + objects. To get the list of projects use: + + .. code-block:: python + + group.projects.list() + + Documentation for ``Group`` objects: + http://python-gitlab.readthedocs.io/en/stable/gl_objects/groups.html#examples diff --git a/gitlab/objects.py b/gitlab/objects.py index efe75d0..3c38e8e 100644 --- a/gitlab/objects.py +++ b/gitlab/objects.py @@ -297,6 +297,11 @@ class GitlabObject(object): return for k, v in data.items(): + # If a k attribute already exists and is a Manager, do nothing (see + # https://github.com/gpocentek/python-gitlab/issues/209) + if isinstance(getattr(self, k, None), BaseManager): + continue + if isinstance(v, list): self.__dict__[k] = [] for i in v: @@ -937,7 +942,6 @@ class GroupAccessRequestManager(BaseManager): class Group(GitlabObject): _url = '/groups' - _constructorTypes = {'projects': 'Project'} requiredCreateAttrs = ['name', 'path'] optionalCreateAttrs = ['description', 'visibility_level'] optionalUpdateAttrs = ['name', 'path', 'description', 'visibility_level'] |