<commit_before>from project import db, bcrypt, app, images
from sqlalchemy.ext.hybrid import hybrid_method, hybrid_property
from datetime import datetime
from markdown import markdown
from flask import url_for
import bleach
from itsdangerous import TimedJSONWebSignatureSerializer as Serializer
import uuid

class TrainingSession(db.Model):

    __tablename__ = "training_session"

    id = db.Column(db.Integer, primary_key=True)
    session_uid = db.Column(db.Integer, default=None, nullable=True, unique=True)
    user_id = db.Column(db.Integer, db.ForeignKey('user.id'), nullable=True)
    completed = db.Column(db.Boolean, default=False, nullable=False)
    created_on = db.Column(db.DateTime, nullable=True)

    def __init__(self, session_uid, user_id=None):
        self.user_id = user_id
        self.session_uid = session_uid
        self.completed = False
        self.created_on = datetime.now()  
    
    def export_data(self):
        return {
            'self_url': self.get_url(),
            'id': self.id,
            'user_id': self.user_id,
            'session_uid': self.session_uid,
            'completed': self.completed,
            'created_on': self.created_on
        }
<commit_msg>Fixed incorrect data type for training session column.<commit_after>from project import db, bcrypt, app, images
from sqlalchemy.ext.hybrid import hybrid_method, hybrid_property
from datetime import datetime
from markdown import markdown
from flask import url_for
import bleach
from itsdangerous import TimedJSONWebSignatureSerializer as Serializer
import uuid

class TrainingSession(db.Model):

    __tablename__ = "training_session"

    id = db.Column(db.Integer, primary_key=True)
    session_uid = db.Column(db.String, nullable=False, unique=True)
    user_id = db.Column(db.Integer, db.ForeignKey('user.id'), nullable=True)
    completed = db.Column(db.Boolean, default=False, nullable=False)
    created_on = db.Column(db.DateTime, nullable=True)

    def __init__(self, session_uid, user_id=None):
        self.user_id = user_id
        self.session_uid = session_uid
        self.completed = False
        self.created_on = datetime.now()  
    
    def export_data(self):
        return {
            'self_url': self.get_url(),
            'id': self.id,
            'user_id': self.user_id,
            'session_uid': self.session_uid,
            'completed': self.completed,
            'created_on': self.created_on
        }

{'fraction_non_alphanumeric': 0.0949857317570322, 'fraction_numerical': 0.0, 'mean_word_length': 3.245674740484429, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6501115', 'n_tokens_mistral': 746, 'n_tokens_neox': 727, 'n_words': 174}