Package musicbrainz2 :: Module model :: Class Rating
[frames] | no frames]

Class Rating

source code

object --+
         |
        Rating

The representation of a MusicBrain rating.

The rating can have the following values:

0 = Unrated [1..5] = Rating

Instance Methods
 
__init__(self, value=None, count=None)
Constructor.
source code
 
getValue(self)
Returns a string with the tag's value.
source code
 
setValue(self, value)
Set the value of this rating.
source code
 
getCount(self)
Returns an integer containing the rating's frequency count.
source code
 
setCount(self, count)
Sets the frequency count of this rating.
source code
 
__str__(self)
str(x)
source code
 
__unicode__(self) source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __subclasshook__

Properties
  value
The value of the rating.
  count
This tag's frequency count.

Inherited from object: __class__

Method Details

__init__(self, value=None, count=None)
(Constructor)

source code 

Constructor.

Parameters:
  • value - a string containing the tag's value
  • count - the number of users who added this tag
Overrides: object.__init__

getValue(self)

source code 

Returns a string with the tag's value.

Returns:
an integer containing the rating's value, or None

setValue(self, value)

source code 

Set the value of this rating.

0 or None = Clear your rating 1 - 5 = Rating

Parameters:
  • value - the rating to apply
Raises:
  • ValueError - if value is not a double or not in the range 0 - 5 or None.

getCount(self)

source code 

Returns an integer containing the rating's frequency count.

Returns:
an integer containing the rating's frequency count, or None

setCount(self, count)

source code 

Sets the frequency count of this rating.

Parameters:
  • count - an integer containing the tag's frequency count

__str__(self)
(Informal representation operator)

source code 

str(x)

Overrides: object.__str__
(inherited documentation)

Property Details

value

The value of the rating.

Get Method:
getValue(self) - Returns a string with the tag's value.
Set Method:
setValue(self, value) - Set the value of this rating.

count

This tag's frequency count.

Get Method:
getCount(self) - Returns an integer containing the rating's frequency count.
Set Method:
setCount(self, count) - Sets the frequency count of this rating.