coherence.backends.models.containers (module)¶
Backend models for Container¶
Backend container to be used as a container for backend items, used by backend
store BackendBaseStore.
The BackendContainer inherits from Container and
will initialize a Container stored into
variable BackendContainer.item. This is the base class for our
containers.
We also provide some more containers:
BackendMusicAlbum: Container which will contain audio items from an album
BackendBasePlaylist: Container which will contain items to be played
Note
To write this module, some of the the old backends has been taken as a reference:
Warning
Be aware that we use super to initialize all the classes of this module in order to have a better MRO class resolution…so…take it into account if you inherit from one of this classes.
New in version 0.8.3.
-
class
BackendContainer(item_id, parent_id, name, **kwargs)[source]¶ Bases:
coherence.backend.ContainerThe BackendContainer will hold the reference to all your instances of BackendItem/s. This class could be used as a container for a simple backend. It is almost the same as a
Containerbut with some slight differences that will make easier to create an inherited class form BackendContainer:The arguments to initialize the BackendContainer are
When we initialize the BackendContainer we also create an attribute item whim will be of
Containerwhich will allow us to perform most of the operations we need to operate with your BackendItem/s
-
logCategory= 'BackendContainer'¶
-
item_cls¶
-
item= None¶ Define the initialized
item_cls. It will be set when the classBackendContaineris initialized based on the attributeitem_cls
-
class
BackendMusicAlbum(item_id, parent_id, name, **kwargs)[source]¶ Bases:
coherence.backends.models.containers.BackendContainerDefinition for a music album. This is an inherited class from
BackendContainerbut we use a different item classMusicAlbumto create our item-
logCategory= 'BackendMusicAlbum'¶
-
item_cls¶
-
-
class
BackendBasePlaylist(item_id, parent_id, name, **kwargs)[source]¶ Bases:
coherence.backends.models.containers.BackendContainerDefinition for a playlist. This is an inherited class from
BackendContainerbut we use a different item classPlaylistContainerto create our item-
logCategory= 'BackendBasePlaylist'¶
-
item_cls¶
-