|
|
|
@ -1,7 +1,20 @@
|
|
|
|
|
#!/usr/bin/env python |
|
|
|
|
# -*- encoding: utf-8 -*- |
|
|
|
|
|
|
|
|
|
"""Database models and functions.""" |
|
|
|
|
|
|
|
|
|
from datetime import date |
|
|
|
|
from pony.orm import * |
|
|
|
|
|
|
|
|
|
db = Database("sqlite", "lyrics.sqlite", create_db=True) |
|
|
|
|
import inspect |
|
|
|
|
import os.path |
|
|
|
|
|
|
|
|
|
file_path = inspect.getsourcefile(self) |
|
|
|
|
file_path = os.path.dirname(file_path) |
|
|
|
|
|
|
|
|
|
db = Database("sqlite", |
|
|
|
|
os.path.join(file_path, "lyrics.sqlite"), |
|
|
|
|
create_db=True) |
|
|
|
|
|
|
|
|
|
class Artist(db.Entity): |
|
|
|
|
name = Required(unicode) |
|
|
|
|