aboutsummaryrefslogtreecommitdiff
path: root/database/models.py
blob: 2f9528a173c8111b17864701cb14c161e5c71bc6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
from peewee import Model, CharField, TextField, PostgresqlDatabase

import config

db = PostgresqlDatabase(config.DB, host=config.DB_HOST, port=config.DB_PORT, user=config.DB_USER, password=config.DB_PASS, autocommit=True, autorollback=True)

class Page(Model):
    """
    Page of a website
    """
    url = CharField()
    title = CharField(null=True)
    content = TextField(null=True)

    class Meta:
        database = db