Browse Source

save the db file with the db settings (maybe I should put this in the app config and make a function to start the db)

master
Julio Biason 11 years ago
parent
commit
2d0004371a
  1. 15
      lyrics/db/__init__.py

15
lyrics/db/__init__.py

@ -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)

Loading…
Cancel
Save