forked from openlp/openlp
cleaned doc
This commit is contained in:
parent
ddc2812ca2
commit
7ff2c27ad7
@ -39,6 +39,7 @@ class Author(BaseModel):
|
|||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
class Book(BaseModel):
|
class Book(BaseModel):
|
||||||
"""
|
"""
|
||||||
Book model
|
Book model
|
||||||
@ -47,34 +48,36 @@ class Book(BaseModel):
|
|||||||
return u'<Book id="%s" name="%s" publisher="%s" />' % (
|
return u'<Book id="%s" name="%s" publisher="%s" />' % (
|
||||||
str(self.id), self.name, self.publisher)
|
str(self.id), self.name, self.publisher)
|
||||||
|
|
||||||
|
|
||||||
class MediaFile(BaseModel):
|
class MediaFile(BaseModel):
|
||||||
"""
|
"""
|
||||||
MediaFile model
|
MediaFile model
|
||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
class Song(BaseModel):
|
class Song(BaseModel):
|
||||||
"""
|
"""
|
||||||
Song model
|
Song model
|
||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
class Topic(BaseModel):
|
class Topic(BaseModel):
|
||||||
"""
|
"""
|
||||||
Topic model
|
Topic model
|
||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
def init_schema(url):
|
def init_schema(url):
|
||||||
"""
|
"""
|
||||||
Setup the songs database connection and initialise the database schema
|
Setup the songs database connection and initialise the database schema.
|
||||||
|
|
||||||
``url``
|
``url``
|
||||||
The database to setup
|
The database to setup
|
||||||
|
|
||||||
The song database is structured as follows::
|
The song database contains the following tables:
|
||||||
|
|
||||||
The song database contains the following tables:
|
|
||||||
* authors
|
* authors
|
||||||
* authors_songs
|
* authors_songs
|
||||||
* media_files
|
* media_files
|
||||||
@ -84,58 +87,47 @@ def init_schema(url):
|
|||||||
* songs_topics
|
* songs_topics
|
||||||
* topics
|
* topics
|
||||||
|
|
||||||
|
*authors* Table
|
||||||
"authors" Table
|
|
||||||
---------------
|
---------------
|
||||||
This table holds the names of all the authors. It has the following
|
This table holds the names of all the authors. It has the following
|
||||||
columns:
|
columns:
|
||||||
|
|
||||||
* id
|
* id
|
||||||
* first_name
|
* first_name
|
||||||
* last_name
|
* last_name
|
||||||
* display_name
|
* display_name
|
||||||
|
|
||||||
|
*authors_songs* Table
|
||||||
"authors_songs" Table
|
|
||||||
---------------------
|
---------------------
|
||||||
This is a bridging table between the "authors" and "songs" tables, which
|
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
|
serves to create a many-to-many relationship between the two tables. It
|
||||||
has the following columns:
|
has the following columns:
|
||||||
|
|
||||||
* author_id
|
* author_id
|
||||||
* song_id
|
* song_id
|
||||||
|
|
||||||
"media_files" Table
|
*media_files* Table
|
||||||
-------------------
|
-------------------
|
||||||
|
|
||||||
* id
|
* id
|
||||||
* file_name
|
* file_name
|
||||||
* type
|
* type
|
||||||
|
|
||||||
|
*media_files_songs* Table
|
||||||
"media_files_songs" Table
|
|
||||||
-------------------------
|
-------------------------
|
||||||
|
|
||||||
* media_file_id
|
* media_file_id
|
||||||
* song_id
|
* song_id
|
||||||
|
|
||||||
|
*song_books* Table
|
||||||
"song_books" Table
|
|
||||||
------------------
|
------------------
|
||||||
The "song_books" table holds a list of books that a congregation gets
|
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
|
their songs from, or old hymnals now no longer used. This table has the
|
||||||
following columns:
|
following columns:
|
||||||
|
|
||||||
* id
|
* id
|
||||||
* name
|
* name
|
||||||
* publisher
|
* publisher
|
||||||
|
|
||||||
|
*songs* Table
|
||||||
"songs" Table
|
|
||||||
-------------
|
-------------
|
||||||
This table contains the songs, and each song has a list of attributes.
|
This table contains the songs, and each song has a list of attributes.
|
||||||
The "songs" table has the following columns:
|
The *songs* table has the following columns:
|
||||||
|
|
||||||
* id
|
* id
|
||||||
* song_book_id
|
* song_book_id
|
||||||
* title
|
* title
|
||||||
@ -150,23 +142,19 @@ def init_schema(url):
|
|||||||
* search_title
|
* search_title
|
||||||
* search_lyrics
|
* search_lyrics
|
||||||
|
|
||||||
|
*songs_topics* Table
|
||||||
"songs_topics" Table
|
|
||||||
--------------------
|
--------------------
|
||||||
This is a bridging table between the "songs" and "topics" tables, which
|
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
|
serves to create a many-to-many relationship between the two tables. It
|
||||||
has the following columns:
|
has the following columns:
|
||||||
|
|
||||||
* song_id
|
* song_id
|
||||||
* topic_id
|
* topic_id
|
||||||
|
|
||||||
|
*topics* Table
|
||||||
"topics" Table
|
|
||||||
--------------
|
--------------
|
||||||
The topics table holds a selection of topics that songs can cover. This
|
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
|
is useful when a worship leader wants to select songs with a certain
|
||||||
theme. This table has the following columns:
|
theme. This table has the following columns:
|
||||||
|
|
||||||
* id
|
* id
|
||||||
* name
|
* name
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user