diff --git a/app/corpora/events.py b/app/corpora/events.py index 7683d7b9..99b8f656 100644 --- a/app/corpora/events.py +++ b/app/corpora/events.py @@ -61,6 +61,11 @@ def corpus_analysis_get_meta_data(corpus_id): metadata['corpus_cqi_py_version'] = cqi.version metadata['corpus_cqpserver_version'] = 'CQPserver v3.4.22' # TODO: make this dynamically + # write some metadata to the db + db_corpus.current_nr_of_tokens = metadata['corpus_size_tokens'] + db.session.commit() + + # emit data payload = metadata response = {'code': 200, 'desc': 'Corpus meta data', 'msg': 'OK', 'payload': payload} socketio.emit('corpus_analysis_send_meta_data', response, room=request.sid) diff --git a/app/models.py b/app/models.py index db6d8640..973c7a84 100644 --- a/app/models.py +++ b/app/models.py @@ -31,7 +31,7 @@ class Role(db.Model): # Fields default = db.Column(db.Boolean, default=False, index=True) name = db.Column(db.String(64), unique=True) - permissions = db.Column(db.Integer) + permissions = db.Column(db.BigInteger) # Relationships users = db.relationship('User', backref='role', lazy='dynamic') @@ -443,8 +443,10 @@ class Corpus(db.Model): user_id = db.Column(db.Integer, db.ForeignKey('users.id')) # Fields creation_date = db.Column(db.DateTime(), default=datetime.utcnow) + current_nr_of_tokens = db.Column(db.BigInteger, default=0) description = db.Column(db.String(255)) last_edited_date = db.Column(db.DateTime(), default=datetime.utcnow) + max_nr_of_tokens = db.Column(db.BigInteger, default=2147483647) status = db.Column(db.String(16)) title = db.Column(db.String(32)) # Relationships diff --git a/app/templates/corpora/corpus.html.j2 b/app/templates/corpora/corpus.html.j2 index b07cad0a..f8604b81 100644 --- a/app/templates/corpora/corpus.html.j2 +++ b/app/templates/corpora/corpus.html.j2 @@ -37,6 +37,14 @@ +