class Assignment(db.DynamicDocument): name = db.StringField(required=True, unique_with=['instructor']) instructor = db.ReferenceField('User', required=True) annotators = db.ListField(db.ReferenceField('User'), default=[]) data_set = db.ReferenceField('DataSet', required=True) queries = db.ListField(db.ReferenceField('Query'), default=[]) ranker = db.StringField(required=True) params = db.DictField(required=True) num_results = db.IntField(default=5) queries_need_to_show = db.ListField(db.ReferenceField('Query'), default=[])
class Assignment(db.DynamicDocument): name = db.StringField(required=True) owner = db.ReferenceField('User', required=True) dataset = db.ReferenceField('Dataset') annotators = db.ListField(db.ReferenceField('User'), required=True) statuses = db.DictField(required=True) ranker = db.StringField(required=True) params = db.DictField(required=True) deadline = db.StringField(required=True) num_results = db.IntField(required=True)
class User(UserMixin, db.Document): meta = {'collection': 'test-user'} name = db.StringField(required=True, unique=True) email = db.StringField(required=True, unique=True) role = db.StringField(required=True, choices=('annotator', 'instructor')) password = db.StringField(required=True) credibility_score = db.FloatField(default=0.75) @staticmethod def hash_password(password): return generate_password_hash(password, method='sha256') def check_password(self, password): return check_password_hash(self.password, password)
class User(db.DynamicDocument): gitlab_id = db.IntField(require=True, unique=True) name = db.StringField(required=True) email = db.StringField(required=True, unique=True)
class Query(db.DynamicDocument): content = db.StringField(required=True, unique=True)
class DataSet(db.Document): author = db.ReferenceField('User', required=True) name = db.StringField(required=True, unique_with=['author'])
class Dataset(db.DynamicDocument): name = db.StringField(required=True) owner = db.ReferenceField("User", required=True) privacy = db.StringField(required=True) collaborators = db.ListField(db.ReferenceField('User'))
class Class(db.Document): owner = db.ReferenceField('User', required=True) name = db.StringField(required=True)
class Document(db.DynamicDocument): name = db.StringField(required=True) data_set = db.ReferenceField('DataSet', required=True) path = db.StringField(required=True, unique=True)
class Query(db.DynamicDocument): content = db.StringField(required=True) assignment = db.ReferenceField('Assignment', required=True) doc_scores = db.DictField(required=True) creator = db.ReferenceField('User', required=True) submitted = db.BooleanField(required=True)
class Annotation(db.DynamicDocument): annotator = db.ReferenceField('User', required=True) document = db.ReferenceField("Document", required=True) query = db.ReferenceField('Query', required=True) judgement = db.StringField(required=True)