-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodels.py
More file actions
36 lines (24 loc) · 769 Bytes
/
models.py
File metadata and controls
36 lines (24 loc) · 769 Bytes
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
from blitzdb import Document, FileBackend
backend = FileBackend('./mob-db')
'''
A user shall have the following attributes: name, email, username/handle, twitter/facebook ID, auth token, karma points, as well
as future references to posts, comments and votes.
'''
class User(Document):
pass
'''
A post shall have the following attributes: title, content, a reference to the user who posted it, timestamp, a list containing
IDs of comments in chronological order, as well as a list of vote IDs.
'''
class Post(Document):
pass
'''
A comment shall have the following attributes: content, a reference to the author.
'''
class Comment(Document):
pass
'''
A vote shall have a reference to the user, and a reference to the post.
'''
class Vote(Document):
pass