-
Notifications
You must be signed in to change notification settings - Fork 11
/
models.py
48 lines (36 loc) · 1.06 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
from dictshield.document import Document, swap_field
from dictshield.fields import (BaseField,
StringField,
BooleanField,
URLField,
EmailField,
LongField)
# this might get moved
from dictshield.fields.mongo import ObjectIdField
from brubeck.models import User
from brubeck.timekeeping import MillisecondField
###
### Social Models
###
### Adjust ID field in Brubeck models
User = swap_field(User, ObjectIdField, ['id'])
###
### List Models
###
class ListItem(Document):
"""Bare minimum to have the concept of streamed item.
"""
# ownable
owner = ObjectIdField(required=True)
username = StringField(max_length=30, required=True)
# streamable
created_at = MillisecondField()
updated_at = MillisecondField()
url = URLField()
class Meta:
id_field = ObjectIdField
_private_fields = [
'owner',
]
def __unicode__(self):
return u'%s' % (self.url)