-
Notifications
You must be signed in to change notification settings - Fork 3
/
models.py
38 lines (34 loc) · 1.37 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
from google.appengine.ext import db
from google.appengine.ext import blobstore
class User(db.Model):
id = db.StringProperty(required=True)
created = db.DateTimeProperty(auto_now_add=True)
updated = db.DateTimeProperty(auto_now=True)
name = db.StringProperty(required=True)
profile_url = db.StringProperty(required=True)
access_token = db.StringProperty(required=True)
email = db.EmailProperty()
user_id = db.IntegerProperty()
user_token = db.StringProperty()
source = db.StringProperty()
avatar = db.StringProperty( default="http://www.instantretro.com/images/avatar.png" )
class Short(db.Model):
user = db.ReferenceProperty(User, collection_name='user')
name = db.StringProperty(required=True)
class Temporal(db.Model):
image = db.BlobProperty()
rackspace = db.StringProperty(default = None)
class Foto(db.Model):
title = db.StringProperty()
rating = db.RatingProperty()
date = db.DateTimeProperty(auto_now_add=True)
image = db.BlobProperty()
thumb = db.BlobProperty()
big = db.BlobProperty()
hint = db.IntegerProperty()
shared = db.BooleanProperty(default = True)
imageblob = blobstore.BlobReferenceProperty()
mobile = db.BooleanProperty(default = False)
published = db.StringProperty()
owner = db.ReferenceProperty(User,
collection_name='owners')