-
Notifications
You must be signed in to change notification settings - Fork 0
/
models.py
54 lines (33 loc) · 1.19 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
from google.appengine.ext import db
from google.appengine.api import users
class Videos(db.Model):
users = db.StringListProperty()
searches = db.StringListProperty()
class Twitter(db.Model):
keywords = db.StringListProperty()
class NewsFeed(db.Model):
name = db.StringProperty()
last_fetch = db.DateTimeProperty()
url = db.LinkProperty()
active = db.BooleanProperty(default=True)
class NewsItem(db.Model):
url = db.LinkProperty()
title = db.StringProperty()
text = db.TextProperty()
date = db.DateTimeProperty()
orderdate = db.DateTimeProperty()
bumps = db.ListProperty(users.User)
sages = db.ListProperty(users.User)
source = db.ReferenceProperty(NewsFeed)
def bumpyness(self):
return len(self.bumps) - len(self.sages)
class Shout(db.Model):
date = db.DateTimeProperty(auto_now_add=True)
text = db.TextProperty()
name = db.StringProperty()
class Comment(db.Model):
newsitem_url = db.LinkProperty()
newsitem = db.ReferenceProperty(NewsItem)
author = db.UserProperty()
content = db.StringProperty(multiline=True)
date = db.DateTimeProperty(auto_now_add=True)