Home | Trees | Index | Help |
---|
Package musicbrainz2 :: Module model :: Class Entity |
|
object
--+
|
Entity
Artist
,
Release
,
Track
A first-level MusicBrainz class.
All entities in MusicBrainz have unique IDs (which are absolute URIs)
and may have any number of relations
to other entities. This class is
abstract and should not be instantiated.
getRelations
and pass one of the following
constants as the parameter:
See Also: Relation
Method Summary | |
---|---|
Constructor. | |
Adds a relation. | |
Returns a MusicBrainz ID. | |
Returns a list of relations. | |
Returns a list of target types available for this entity. | |
Sets a MusicBrainz ID. | |
Inherited from object | |
x.__delattr__('name') <==> del x.name | |
x.__getattribute__('name') <==> x.name | |
x.__hash__() <==> hash(x) | |
T.__new__(S, ...) -> a new object with type S, a subtype of T | |
helper for pickle | |
helper for pickle | |
x.__repr__() <==> repr(x) | |
x.__setattr__('name', value) <==> x.name = value | |
x.__str__() <==> str(x) |
Property Summary | |
---|---|
id : The MusicBrainz ID. |
Method Details |
---|
__init__(self,
id_=None)
|
addRelation(self, relation)Adds a relation. This method addsrelation to the list of relations. The
given relation has to be initialized, at least the target type has to
be set.
|
getId(self)Returns a MusicBrainz ID.
|
getRelations(self, targetType=None, relationType=None)Returns a list of relations. IftargetType is given, only relations of that target
type are returned. For MusicBrainz, the following target types are
defined:
If relationType parameter to further
restrict the selection. If it is set, only relations with the given
relation type are returned.
|
getRelationTargetTypes(self)Returns a list of target types available for this entity. Use this to find out to which types of targets this entity has relations. If the entity only has relations to tracks and artists, for example, then a list containg the stringsRelation.TO_TRACK and Relation.TO_ARTIST is returned.
|
setId(self, value)Sets a MusicBrainz ID.
|
Property Details |
---|
idThe MusicBrainz ID. |
Home | Trees | Index | Help |
---|
Generated by Epydoc 2.1 on Sat Aug 26 18:34:32 2006 | http://epydoc.sf.net |