From 65bce46983b90af1453986ce69f5ed2e6a5bdd63 Mon Sep 17 00:00:00 2001 From: Stein Magnus Jodal Date: Sat, 13 Mar 2010 20:50:51 +0100 Subject: [PATCH] docs: Add intro to model API --- docs/api/models.rst | 36 +++++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/docs/api/models.rst b/docs/api/models.rst index a0e4f0b6..8be375ef 100644 --- a/docs/api/models.rst +++ b/docs/api/models.rst @@ -1,18 +1,28 @@ -********************************************* -:mod:`mopidy.models` -- Immutable data models -********************************************* +******************** +:mod:`mopidy.models` +******************** + +These immutable data models are used for all data transfer within the Mopidy +backends and between the backends and the MPD frontend. All fields are optional +and immutable. In other words, they can only be set through the class +constructor during instance creation. + + +Data model relations +==================== + +.. digraph:: model_relations + + Playlist -> Track [ label="has 0..n" ] + Track -> Album [ label="has 0..1" ] + Track -> Artist [ label="has 0..n" ] + Album -> Artist [ label="has 0..n" ] + + +Data model API +============== .. automodule:: mopidy.models :synopsis: Immutable data models. :members: :undoc-members: - -Model relations -=============== - -.. digraph:: model_relations - - Playlist -> Track [ label="has multiple" ] - Track -> Album [ label="has one" ] - Track -> Artist [ label="has multiple" ] - Album -> Artist [ label="has multiple" ]