-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema.py
133 lines (101 loc) · 4.02 KB
/
schema.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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
from google.appengine.ext import db
from google.appengine.ext import blobstore
class Account(db.Model):
id = db.StringProperty()
nickname = db.StringProperty()
email = db.EmailProperty(required=True)
googleNickname = db.StringProperty()
name = db.StringProperty()
level = db.StringProperty()
status = db.StringProperty()
description = db.TextProperty()
profilePicBlobKey = db.StringProperty()
accountSince = db.DateTimeProperty()
isStudent = db.BooleanProperty()
isStudentUntil = db.DateTimeProperty()
showName = db.BooleanProperty()
showEmail = db.BooleanProperty()
authType = db.StringProperty()
class ShopItem(db.Model):
title = db.StringProperty()
description = db.TextProperty()
profilePicBlobKey = db.StringProperty()
picBlobKeys = db.StringListProperty()
videoBlobKeys = db.StringListProperty()
markedPrice = db.IntegerProperty()
discountPrice = db.IntegerProperty()
quantity = db.IntegerProperty()
status = db.StringProperty() # active, inactive
privacy = db.StringProperty() # Public(all), Custom(select viewer)
creationDate = db.DateTimeProperty()
expiryDate = db.DateTimeProperty()
expireIn = db.IntegerProperty()
paymentMethod = db.StringProperty()
owner = db.StringProperty()
viewCount = db.IntegerProperty()
class Conversation(db.Model):
title = db.StringProperty(required=True)
shopItemId = db.StringProperty()
shopItemPrice = db.IntegerProperty()
shopItemTitle = db.StringProperty()
partnerConversationId = db.StringProperty() # NEW
recordDate = db.DateTimeProperty(required=True,auto_now_add=True)
class ConversationAssignment(db.Model):
conversation = db.ReferenceProperty(Conversation, collection_name='conversationAssignment')
ownerAccount = db.ReferenceProperty(Account, collection_name='accountConversationAssignment')
lastModifiedDate = db.DateTimeProperty(auto_now=True)
class Message(db.Model):
sender = db.StringProperty(required=True)
senderApplicationId = db.StringProperty() # NEW
senderId = db.StringProperty() # NEW
recipient = db.StringProperty(required=True)
content = db.TextProperty(required=True)
owner = db.StringProperty(required=True) # who can see this message
isRead = db.BooleanProperty()
parentConversation = db.ReferenceProperty(Conversation, collection_name='messages')
date = db.DateTimeProperty(required=True,auto_now_add=True)
class WishList(db.Model):
nickname = db.StringProperty()
shopItemId = db.StringProperty()
class EventLog(db.Model):
actor = db.StringProperty(required=True)
actionType = db.StringProperty(required=True)
target = db.StringProperty()
content = db.StringProperty()
date = db.DateTimeProperty(required=True,auto_now_add=True)
class KeywordRepo(db.Model):
shopItemId = db.StringProperty(required=True)
keyword = db.StringProperty(required=True)
weight = db.IntegerProperty(required=True)
class Transaction(db.Model):
actor = db.StringProperty(required=True)
owner = db.StringProperty(required=True)
status = db.StringProperty()
itemId = db.StringProperty(required=True)
quantity = db.IntegerProperty(required=True)
recordDate = db.DateTimeProperty(required=True,auto_now_add=True)
endDate = db.DateTimeProperty()
itemTitle = db.StringProperty()
itemPrice = db.IntegerProperty()
class StudentAccountVerification(db.Model):
account = db.StringProperty(required=True)
email = db.StringProperty(required=True)
date = db.DateTimeProperty(required=True,auto_now_add=True)
# with memcache
class ApplicationSettings(db.Model):
type = db.StringProperty(required=True)
name = db.StringProperty()
value = db.StringProperty(required=True)
remarks = db.TextProperty()
#
class ApplicationApiSettings(db.Model):
domain = db.StringProperty(required=True)
token = db.StringProperty(required=True)
apiType = db.StringProperty(required=True)
remarks = db.TextProperty()
# not implemented yet
class Rating(db.Model):
rater = db.StringProperty() # the user who wrote the comment
shopItemId = db.StringProperty()
rating = db.IntegerProperty()
comment = db.StringProperty()