From c01eb0e3220924c24aabc3ccd282f89f9ed9cb3e Mon Sep 17 00:00:00 2001 From: neodarz Date: Fri, 11 Jan 2019 23:41:00 +0100 Subject: Add first implementation of a database --- database/__init__.py | 0 database/models.py | 17 +++++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 database/__init__.py create mode 100644 database/models.py (limited to 'database') diff --git a/database/__init__.py b/database/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/database/models.py b/database/models.py new file mode 100644 index 0000000..4b27806 --- /dev/null +++ b/database/models.py @@ -0,0 +1,17 @@ +from peewee import Model, CharField, SqliteDatabase + +import config + +db = SqliteDatabase(config.DATABASE) +db.connect() + +class Page(Model): + """ + Page of a website + """ + url = CharField() + title = CharField() + content = CharField() + + class Meta: + database = db -- cgit v1.2.1