This repository has been archived by the owner on Apr 28, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 64
/
models.py
105 lines (82 loc) · 2.5 KB
/
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# coding: utf8
from peewee import SqliteDatabase, Model, BooleanField, IntegerField, DateTimeField, CharField
from config import config
database = SqliteDatabase(config.DATABASE)
class BaseModel(Model):
class Meta:
database = database
class User(BaseModel):
uid = IntegerField(unindexed=True)
name = CharField()
headPic = CharField()
class Comment(BaseModel):
id = IntegerField(unique=True)
t = DateTimeField(index=True)
entry_id = IntegerField(index=True)
entry_type = CharField(index=True)
authorId = IntegerField()
authorName = CharField()
content = CharField()
class Like(BaseModel):
entry_id = IntegerField(index=True)
entry_type = CharField()
uid = IntegerField()
class Meta:
indexes = (
(('entry_id', 'uid'), True),
)
class Status(BaseModel):
id = IntegerField(unique=True)
t = DateTimeField(index=True)
content = CharField(default="")
like = IntegerField(default=0)
repeat = IntegerField(default=0)
comment = IntegerField(default=0)
rootContent = CharField(default="")
rootUid = IntegerField(default=0)
rootUname = CharField(default="")
class Gossip(BaseModel):
id = IntegerField(unique=True)
t = DateTimeField(index=True)
guestId = IntegerField(index=True)
guestName = CharField()
headPic = CharField()
attachSnap = CharField()
attachPic = CharField()
whisper = BooleanField()
wap = BooleanField()
gift = CharField()
content = CharField()
class Blog(BaseModel):
id = IntegerField(unique=True)
t = DateTimeField(index=True)
category = CharField()
title = CharField()
summary = CharField()
content = CharField()
comment = IntegerField()
share = IntegerField()
like = IntegerField()
read = IntegerField()
class Album(BaseModel):
id = IntegerField(unique=True)
name = CharField()
desc = CharField()
cover = CharField()
count = IntegerField()
comment = IntegerField()
share = IntegerField()
like = IntegerField()
class Photo(BaseModel):
id = IntegerField(unique=True)
album_id = IntegerField(index=True)
pos = IntegerField(index=True)
prev = IntegerField()
next = IntegerField()
t = DateTimeField()
title = CharField()
src = CharField()
comment = IntegerField()
share = IntegerField()
like = IntegerField()
view = IntegerField()