You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
763 B
Python

from datetime import datetime
from peewee import *
from supportbot import config
db = SqliteDatabase(config.SQLITE_DB_PATH)
class BaseModel(Model):
class Meta:
database = db
class IRCSupportOperator(BaseModel):
irc_nick = CharField()
is_a_regular = BooleanField(default=False)
is_support_admin = BooleanField(default=False)
class SupportRequest(BaseModel):
post_id = CharField()
timestamp = DateTimeField(default=datetime.now)
author = CharField()
title = CharField()
permalink = CharField()
solved = BooleanField(default=False)
assigned = BooleanField(default=False)
assignee = ForeignKeyField(IRCSupportOperator, backref='assignee', null=True)
db.create_tables([SupportRequest, IRCSupportOperator])