class Post2(mongo_db.Document): created_at = mongo_db.DateTimeField(default=datetime.datetime.now, required=True) title = mongo_db.StringField(max_length=255, required=True) slug = mongo_db.StringField(max_length=255, required=True) body = mongo_db.StringField(required=True) comments = mongo_db.ListField(mongo_db.EmbeddedDocumentField('Comment')) def get_absolute_url(self): return url_for('post', kwargs={"slug": self.slug}) def __unicode__(self): return self.title meta = { 'allow_inheritance': True, 'indexes': ['-created_at', 'slug'], 'ordering': ['-created_at'] }
class Events(mongo_db.Document): created_at = mongo_db.DateTimeField(default=datetime.datetime.now, required=True) comments = mongo_db.ListField(mongo_db.EmbeddedDocumentField('Comment'))
class EventCategories(mongo_db.Document): created_at = mongo_db.DateTimeField(default=datetime.datetime.now, required=True) name = mongo_db.StringField(max_length=255, required=True) description = mongo_db.StringField(max_length=255, required=True)
class Event(mongo_db.Document): created_at = mongo_db.DateTimeField(default=datetime.datetime.now, required=True) comments = mongo_db.ListField(mongo_db.EmbeddedDocumentField('Comment')) event_type = mongo_db.StringField(max_length=255, required=True)
class Glucose(mongo_db.Document): created_at = mongo_db.DateTimeField(default=datetime.datetime.now, required=True) comments = mongo_db.ListField(mongo_db.EmbeddedDocumentField('Comment')) user_id = mongo_db.StringField(max_length=24, required=True) reading = mongo_db.IntField(required=True)
class UserSession(mongo_db.Document): exp_time = datetime.datetime.now() + datetime.timedelta(minutes=60) sid = mongo_db.StringField(primary_key=True, default=str(uuid.uuid4())) created_at = mongo_db.DateTimeField(default=datetime.datetime.now) user_id = mongo_db.StringField(max_length=24, required=True) expiration = mongo_db.DateTimeField(default=exp_time)
class User(mongo_db.Document): created_at = mongo_db.DateTimeField(default=datetime.datetime.now) fname = mongo_db.StringField(max_length=64, required=True) lname = mongo_db.StringField(max_length=64, required=True) email = mongo_db.StringField(max_length=255, required=True) fb_id = mongo_db.IntField()