forked from zhangchunlin/uliweb-apijson
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathmodels.py
More file actions
44 lines (36 loc) · 1.12 KB
/
models.py
File metadata and controls
44 lines (36 loc) · 1.12 KB
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
#coding=utf-8
from uliweb.orm import *
class Privacy(Model):
user_id = Reference("user")
certified = Field(bool)
phone = Field(str)
balance = Field(DECIMAL)
password = Field(str)
paypassword = Field(str)
class Moment(Model):
user_id = Reference("user")
date = Field(datetime.datetime, auto_now_add=True)
content = Field(TEXT)
picture_list = Field(JSON, default=[])
@classmethod
def owner_condition(cls,user_id):
print("Moment: owner_condition")
return cls.c.user_id==user_id
class Comment(Model):
user_id = Reference("user")
to_id = Reference("user")
moment_id = Reference("moment")
date = Field(datetime.datetime, auto_now_add=True)
content = Field(TEXT)
class Comment2(Model):
user_id = Reference("user")
to_id = Reference("user")
moment_id = Reference("moment")
date = Field(datetime.datetime, auto_now_add=True)
content = Field(TEXT)
class PublicNotice(Model):
date = Field(datetime.datetime, auto_now_add=True)
content = Field(TEXT)
class NoRequestTag(Model):
user_id = Reference("user")
content = Field(TEXT)