Example #1
0
	def to_dict_full(self, user = None):
		d = super(Album, self).to_dict_full(user)
		if user:
			d.update(rating.get_album_rating(self.sid, self.id, user.id))
		else:
			d['rating_user'] = None
			d['fave'] = None
		return d
Example #2
0
	def to_dict_full(self, user = None):
		d = super(Album, self).to_dict_full(user)
		if user:
			d.update(rating.get_album_rating(self.sid, self.id, user.id))
		else:
			d['rating_user'] = None
			d['fave'] = None
		return d
Example #3
0
	def to_dict(self, user = None):
		d = {}
		d['id'] = self.id
		for v in [ 'rating', 'art', 'name' ]:
			d[v] = self.data[v]

		if user:
			d.update(rating.get_album_rating(self.sid, self.id, user.id))
		else:
			d['rating_user'] = None
			d['fave'] = None
		return d
Example #4
0
	def to_dict(self, user = None):
		d = {}
		d['id'] = self.id
		for v in [ 'rating', 'art', 'name' ]:
			d[v] = self.data[v]

		if user:
			d.update(rating.get_album_rating(self.sid, self.id, user.id))
		else:
			d['rating_user'] = None
			d['fave'] = None
		return d
Example #5
0
    def to_dict(self, user=None):
        d = {}
        d["id"] = self.id
        for v in ["rating", "art", "name"]:
            d[v] = self.data[v]

        if user:
            d.update(rating.get_album_rating(self.sid, self.id, user.id))
        else:
            d["rating_user"] = None
            d["fave"] = None
        return d
Example #6
0
    def to_dict(self, user=None):
        d = {}
        d["id"] = self.id
        for v in ["rating", "art", "name"]:
            d[v] = self.data[v]

        if user:
            d.update(rating.get_album_rating(self.sid, self.id, user.id))
        else:
            d["rating_user"] = None
            d["fave"] = None
        return d