-
Notifications
You must be signed in to change notification settings - Fork 0
/
check_yt_models.py
83 lines (69 loc) · 2.37 KB
/
check_yt_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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# -*- coding: utf-8 -*-
from pony import orm
import pony.orm.dbproviders.sqlite
import datetime
#orm.set_sql_debug(True)
db = orm.Database()
@db.on_connect(provider='sqlite')
def sqlite_case_sensitivity(db, connection):
cursor = connection.cursor()
cursor.execute('PRAGMA case_sensitive_like = OFF')
db.bind(provider='sqlite', filename='checkytdb.sqlite', create_db=True)
class CheckData(db.Entity):
dt = orm.Required(datetime.datetime, default=datetime.datetime.now())
url = orm.Optional(str)
data = orm.Optional(orm.Json)
class TagSEO(db.Entity):
dt = orm.Required(datetime.datetime, default=datetime.datetime.now())
vid = orm.Required(str)
url = orm.Required(str)
tag = orm.Required(str)
seo = orm.Optional(float)
real = orm.Optional(float)
tcount = orm.Optional(int)
tpopular = orm.Optional(int)
tintitle = orm.Optional(int)
tindesc = orm.Optional(int)
triple = orm.Optional(int)
tshow = orm.Optional(float)
ranked = orm.Optional(int)
hivolume = orm.Optional(float)
data = orm.Optional(orm.Json)
class TagUpdate(db.Entity):
dt = orm.Required(datetime.datetime, default=datetime.datetime.now())
vid = orm.Required(str)
tags1 = orm.Required(str)
real1 = orm.Optional(float)
tshow1 = orm.Optional(float)
tags2 = orm.Required(str)
real2 = orm.Optional(float)
tshow2 = orm.Optional(float)
jdata = orm.Optional(orm.Json)
saved = orm.Optional(int)
class TagImport(db.Entity):
url = orm.Required(str)
tag = orm.Required(str)
ttype = orm.Required(str)
# дата не нужна, потому что будет использоваться дата в таблице TagSEO
class TagSEOArch(db.Entity):
dt = orm.Required(datetime.datetime, default=datetime.datetime.now())
vid = orm.Required(str)
url = orm.Required(str)
tag = orm.Required(str)
seo = orm.Optional(float)
real = orm.Optional(float)
tcount = orm.Optional(int)
tpopular = orm.Optional(int)
tintitle = orm.Optional(int)
tindesc = orm.Optional(int)
triple = orm.Optional(int)
tshow = orm.Optional(float)
ranked = orm.Optional(int)
hivolume = orm.Optional(float)
data = orm.Optional(orm.Json)
class Like2Video(db.Entity):
dt = orm.Required(datetime.datetime, default=datetime.datetime.now())
vid = orm.Required(str)
auser = orm.Required(str)
jdata = orm.Optional(orm.Json)
db.generate_mapping(create_tables=True)