Beispiel #1
0
class User(db.Document):
    username = db.StringField(required=True, max_length=20)   # , unique=True
    password = db.StringField(required=True, max_length=100)
    email = db.StringField(required=True)  # , unique=True
Beispiel #2
0
class SaveLogs(db.Document):
    group_id = db.ReferenceField('Group')
    message = db.ListField(db.StringField())
Beispiel #3
0
class Post(db.Document):
    user_id = db.ReferenceField('User')
    group_id = db.ReferenceField('Group')
    content = db.StringField(required=True, max_length=200)
    approval = db.StringField(Default=False, required=True, max_length=10)
    date_created = db.DateTimeField(default=datetime.datetime.now())
Beispiel #4
0
class Comment(db.Document):
    user_id = db.ReferenceField('User')
    post_id = db.ReferenceField('Post')
    content = db.StringField(required=True, max_length=75)
    date_created = db.DateTimeField(default=datetime.datetime.now())
Beispiel #5
0
class Group(db.Document):
    name = db.StringField(required=True, Unique=True, max_length=30)
    visibility = db.StringField(default='public')
    role_dict = db.DictField()  # fill with {'user_id':'role'}
    date_created = db.DateTimeField(default=datetime.datetime.now())
    last_active_dict = db.DictField()  # fill with {'user_id':'last active time'}