-
Notifications
You must be signed in to change notification settings - Fork 1
/
db.py
33 lines (27 loc) · 766 Bytes
/
db.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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from datetime import datetime
from pony.orm import *
botDB = Database()
class Chat(botDB.Entity):
primary_id = PrimaryKey(int, auto=True)
# Telegram info
chat_id = Required(int, size=64, unique=True)
user_id = Required(int)
username = Optional(str)
first_name = Optional(str)
last_name = Optional(str)
# datetimes
open_date = Required(datetime)
last_message_date = Optional(datetime)
# Parameters
silent_mode = Required(bool)
deleted = Required(bool)
group_id = Optional(str)
realname = Optional(str)
contacts = Optional(str)
masterskaya = Optional(str)
places = Optional(str)
gender = Optional(str)
# State
state = Required(str)