aboutsummaryrefslogtreecommitdiff
path: root/database/models.py
blob: a4c3f659c32189992426ba622e31d3f3d828cda2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
from peewee import Model, CharField, TextField, IntegerField, 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)
    content_length = IntegerField()

    class Meta:
        database = db

class Neodarznet(Page):
    """
    Page of neodarz.net website
    """
    pass

class Nevrax(Page):
    """
    Page of nevrax website
    """
    pass