Database Tables - ntdragon/python-LitMusicSug GitHub Wiki

Database Tables

There is a table to define the songs in the various songbooks, a table to define the suggestions, and a table to define the templates used to output the suggestions.

Songs

Index Book Number Type Title
1 GC 102 Psalm Some Psalm Title
2 G3 202 Song Some Song Title
3 G3 202 Song Song Title
... ... ... ... ...
17 GC 173 Song Amazing Grace
... ... ... ... ...

The song table includes entries for all tho songs from all the possible songbooks which might be referenced for the parish. The index is a unique identifier which can be used as a foreign key from the suggestions table. The book is an identifier for the songbook it is found in. If an abbreviation (as above) is used for the songbook, we might want to have a table giving the printable name of the book keyed to the abbreviation. The number is the value printed for the number of the song in the book and the Title is the printed title to be used.

Converting Song Table

Suggestions

Liturgical Year Event Suggestion Origin
C 30th Sunday in Ordinary Time 17 NPM
C 30th Sunday in Ordinary Time 1 Local

The table gives a list of suggestions based on the liturgical year and the event. The origin of the suggestion is kept, as that will allow replacing the suggestions from a particular origin; e.g. a new edition of the suggestions, or to limit the desired suggestion to a particular set of origins.

Converting Suggestion Table

Templates

Identifier Template Format Template Text
Name Format Name RTF or other text string with placeholders

For any particular run, the suggestions selected are printed based on a template, with the specific suggestions selected being inserted into the placeholder spots in the template. We may also want to allow certain other placeholders, like the Liturgical Year, Event, and perhaps values chosen from the profile. The selection process can be driven by the placeholders, with the user being prompted to make selections for each placeholder. The placeholders might allow multiple selections, if that is desirable. (A very simple template might just have a single placeholder, allowing the user to make all the selections, which are then output. The template format allows for different templating engines, so that some templates could be writting in RTF, others in CSV, still others in Genshi or other 3rd party templating engines.