Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Initial modeling commit.

  • Loading branch information...
commit 2b5d5dcaed461c2a3e81db137ca530e548ac9a42 1 parent 9085ba7
@jmlane authored
Showing with 26 additions and 0 deletions.
  1. +26 −0 models.py
View
26 models.py
@@ -0,0 +1,26 @@
+from google.appengine.ext import db
+
+class Users(db.Model):
+ name = db.StringProperty(required=True)
+ email = db.EmailProperty(required=True)
+ created_on = db.DateProperty(auto_now_add=True)
+
+class TwitterAccounts(db.Model):
+ screen_name = db.StringProperty(required=True)
+ id = db.IntegerProperty(required=True)
+ name = db.StringProperty()
+ description = db.StringProperty()
+ location = db.StringProperty()
+ url = db.LinkProperty()
+
+ @property
+ def mentions(self):
+ return Tweets.filter('mentions =', self.key())
+
+class Tweets(db.Model):
+ author = db.ReferenceProperty(TwitterAccounts,
+ collection_name='tweets')
+ body = db.StringProperty(required=True)
+ in_reply_to = db.SelfReferenceProperty(collection_name='replies')
+ mentions = db.ListProperty(db.Key)
+ geo = db.GeoPtProperty()
Please sign in to comment.
Something went wrong with that request. Please try again.