forked from comcomUBA/dcubabot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
models.py
46 lines (28 loc) · 782 Bytes
/
models.py
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/usr/bin/python3
# -*- coding: utf-8 -*-
from pony.orm import *
db = Database()
class Command(db.Entity):
name = Required(str)
description = Optional(str)
args = Required(bool, default=False)
class Listable(db.Entity):
name = Required(str)
url = Required(str)
chat_id = Optional(int, size=64)
validated = Required(bool, default=False)
class Obligatoria(Listable):
cubawiki_url = Optional(str)
class Optativa(Listable):
pass
class Otro(Listable):
pass
class Noitip(db.Entity):
text = Required(str)
class AsmInstruction(db.Entity):
mnemonic = Required(str)
summary = Required(str)
url = Required(str)
def init_db(path):
db.bind('sqlite', path, create_db=True)
db.generate_mapping(create_tables=True)