Skip to content

Commit

Permalink
Document artists and artists_sort attributes
Browse files Browse the repository at this point in the history
of Release class so they get rendered nicely via Sphinx autodoc. To remove the
inherited clutter of undocumented attributes an empty autodoc comment (#:)
was attached to the rest of the classes attributes.
  • Loading branch information
JOJ0 committed Sep 25, 2022
1 parent f7f5a89 commit dc6ed5b
Showing 1 changed file with 25 additions and 19 deletions.
44 changes: 25 additions & 19 deletions discogs_client/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -483,27 +483,33 @@ def __repr__(self):


class Release(PrimaryAPIObject):
id = SimpleField()
title = SimpleField()
year = SimpleField()
thumb = SimpleField()
data_quality = SimpleField()
status = SimpleField()
genres = SimpleField()
images = SimpleField()
country = SimpleField()
notes = SimpleField()
formats = SimpleField()
styles = SimpleField()
url = SimpleField(key='uri')
videos = ListField('Video')
tracklist = ListField('Track')
"""An object describing a Discogs release."""
id = SimpleField() #:
title = SimpleField() #:
year = SimpleField() #:
thumb = SimpleField() #:
data_quality = SimpleField() #:
status = SimpleField() #:
genres = SimpleField() #:
images = SimpleField() #:
country = SimpleField() #:
notes = SimpleField() #:
formats = SimpleField() #:
styles = SimpleField() #:
url = SimpleField(key='uri') #:
videos = ListField('Video') #:
tracklist = ListField('Track') #:
#: A list of ``Artist`` objects. Even though a release could be by one
#: artist only, this will always be a list.
artists = ListField('Artist')
#: On multi-artist releases this attribute provides a string containing
#: artists joined together with keywords like "And", "Feat", "Vs", ...
#: Eg. "DJ ABC Feat MC Z".
artists_sort = SimpleField()
credits = ListField('Artist', key='extraartists')
labels = ListField('Label')
companies = ListField('Label')
community = ObjectField("communitydetails")
credits = ListField('Artist', key='extraartists') #:
labels = ListField('Label') #:
companies = ListField('Label') #:
community = ObjectField("communitydetails") #:

def __init__(self, client, dict_):
super(Release, self).__init__(client, dict_)
Expand Down

0 comments on commit dc6ed5b

Please sign in to comment.