<reponame>binh-vu/rad
import os

from peewee import SqliteDatabase, Model, BooleanField, TextField


db = SqliteDatabase(os.environ["DBFILE"])


class TodoList(Model):
    class Meta:
        database = db
        db_table = "todo_list"

    checked = BooleanField()
    todo = TextField()


if not os.path.exists(os.environ["DBFILE"]):
    db.create_tables([TodoList], safe=True)
    TodoList.insert_many(
        [
            {"checked": False, "todo": "pay the bill"},
            {"checked": False, "todo": "submit homework 1"},
        ]
    ).execute()

import os

from peewee import SqliteDatabase, Model, BooleanField, TextField


db = SqliteDatabase(os.environ["DBFILE"])


class TodoList(Model):
    class Meta:
        database = db
        db_table = "todo_list"

    checked = BooleanField()
    todo = TextField()


if not os.path.exists(os.environ["DBFILE"]):
    db.create_tables([TodoList], safe=True)
    TodoList.insert_many(
        [
            {"checked": False, "todo": "pay the bill"},
            {"checked": False, "todo": "submit homework 1"},
        ]
    ).execute()