-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodels.py
More file actions
33 lines (27 loc) · 1.13 KB
/
models.py
File metadata and controls
33 lines (27 loc) · 1.13 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
from google.appengine.ext import ndb
class Content(ndb.Model):
"""Models an individual content entry with author, content, and date."""
author = ndb.UserProperty()
content = ndb.StringProperty(indexed=False)
date = ndb.DateTimeProperty(auto_now_add=True)
class SubContent(Content):
"""Models a subcontent entry, based on Content."""
class Rating(ndb.Model):
"""Models rating for content entries with user, Content, date and rating."""
user = ndb.UserProperty()
content = ndb.KeyProperty()
date = ndb.DateTimeProperty(auto_now_add=True)
rating = ndb.IntegerProperty()
class Agreement(ndb.Model):
"""Models an agreement of a user, url, and date."""
user = ndb.UserProperty()
url = ndb.StringProperty()
date = ndb.DateTimeProperty(auto_now_add=True)
class UserDetails(ndb.Model):
"""Models details for an individual user."""
user = ndb.UserProperty()
created = ndb.DateTimeProperty(auto_now_add=True)
age = ndb.IntegerProperty()
years_of_training = ndb.IntegerProperty()
# recruited_through_sona = ndb.BooleanProperty()
# sona_number = ndb.IntegerProperty()