romeotools/classes/profile.py

15 lines
366 B
Python

from .database import Database
class Profile:
def __init__(self, id, name):
self.id = id
self.name = name
def to_database(self, exceptions=False):
try:
Database().execute("INSERT INTO profile VALUES (?, ?);", (self.id, self.name))
except:
if not exceptions:
return
raise