From fb6d3e7724ae6364430f36f8f7ab9cec130425db Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Thu, 3 Feb 2011 18:11:41 +0100 Subject: [PATCH] fixed docs --- openlp/plugins/songs/lib/db.py | 94 +++++++++++++++++----------------- 1 file changed, 47 insertions(+), 47 deletions(-) diff --git a/openlp/plugins/songs/lib/db.py b/openlp/plugins/songs/lib/db.py index fa42971b3..2bbf818b3 100644 --- a/openlp/plugins/songs/lib/db.py +++ b/openlp/plugins/songs/lib/db.py @@ -71,6 +71,7 @@ class Topic(BaseModel): def init_schema(url): + """ Setup the songs database connection and initialise the database schema. @@ -78,6 +79,7 @@ def init_schema(url): The database to setup The song database contains the following tables: + * authors * authors_songs * media_files @@ -87,76 +89,74 @@ def init_schema(url): * songs_topics * topics - *authors* Table - --------------- + **authors** Table This table holds the names of all the authors. It has the following columns: - * id - * first_name - * last_name - * display_name - *authors_songs* Table - --------------------- + * id + * first_name + * last_name + * display_name + + **authors_songs Table** This is a bridging table between the *authors* and *songs* tables, which serves to create a many-to-many relationship between the two tables. It has the following columns: - * author_id - * song_id - *media_files* Table - ------------------- - * id - * file_name - * type + * author_id + * song_id - *media_files_songs* Table - ------------------------- - * media_file_id - * song_id + **media_files Table** + * id + * file_name + * type - *song_books* Table - ------------------ + **media_files_songs Table** + * media_file_id + * song_id + + **song_books Table** The *song_books* table holds a list of books that a congregation gets their songs from, or old hymnals now no longer used. This table has the following columns: - * id - * name - * publisher - *songs* Table - ------------- + * id + * name + * publisher + + **songs Table** This table contains the songs, and each song has a list of attributes. The *songs* table has the following columns: - * id - * song_book_id - * title - * alternate_title - * lyrics - * verse_order - * copyright - * comments - * ccli_number - * song_number - * theme_name - * search_title - * search_lyrics - *songs_topics* Table - -------------------- + * id + * song_book_id + * title + * alternate_title + * lyrics + * verse_order + * copyright + * comments + * ccli_number + * song_number + * theme_name + * search_title + * search_lyrics + + **songs_topics Table** This is a bridging table between the *songs* and *topics* tables, which serves to create a many-to-many relationship between the two tables. It has the following columns: - * song_id - * topic_id - *topics* Table - -------------- + * song_id + * topic_id + + **topics Table** The topics table holds a selection of topics that songs can cover. This is useful when a worship leader wants to select songs with a certain theme. This table has the following columns: - * id - * name + + * id + * name """ session, metadata = init_db(url)