Permalink
Browse files

Initial modeling commit.

  • Loading branch information...
1 parent 9085ba7 commit 2b5d5dcaed461c2a3e81db137ca530e548ac9a42 @jmlane committed Apr 4, 2012
Showing with 26 additions and 0 deletions.
  1. +26 −0 models.py
View
@@ -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()

0 comments on commit 2b5d5dc

Please sign in to comment.