use a lambda for singleton field (#680)

Avoids a naming collision for now. We might revert this later with a decorator
approach.
This commit is contained in:
Adrian Sampson 2014-04-12 13:49:53 -07:00
parent 2ec140edbc
commit 91537bc3d1

View file

@ -263,7 +263,7 @@ class Item(LibModel):
@classmethod
def _getters(cls):
getters = plugins.item_field_getters()
getters['singleton'] = Item.singleton
getters['singleton'] = lambda i: i.album_id is None
return getters
@classmethod
@ -291,11 +291,6 @@ class Item(LibModel):
super(Item, self).__setitem__(key, value)
def singleton(self):
"""Returns a boolean indicating whether this item is a singleton
(doesn't belong to an album)"""
return self.album_id is None
def update(self, values):
"""Set all key/value pairs in the mapping. If mtime is
specified, it is not reset (as it might otherwise be).