emmental/db/__init__.py
Anna Schumaker bbb248f665 db: Create a DiscTable and Disc object
To represent each disc of an album. Discs may have different subtitles
that we want to display (or there may not be a subtitle at all). Casting
a Disc to a string either appends the subtitle to the album name or
returns the album name directly. This is intended to be used by the
ColumnView to display album names

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-08-23 13:13:48 -04:00

23 lines
474 B
Python

# Copyright 2021 (c) Anna Schumaker.
import lib
import sqlite3
File = lib.data.emmental_data / "emmental.sqlite3"
Connection = sqlite3.connect(File)
Connection.row_factory = sqlite3.Row
commit = Connection.commit
execute = Connection.execute
executemany = Connection.executemany
from . import artist
from . import album
from . import disc
def reset():
mods = [ artist, album, disc ]
for mod in mods: mod.Table.drop()
for mod in mods: mod.Table.do_create()