<commit_before>from gitmostwanted.app import db
from gitmostwanted.models.repo import Repo
from sqlalchemy.ext.declarative import declared_attr


class ReportBase(db.Model):
    __abstract__ = True

    @declared_attr
    def id(self):
        return db.Column(db.BigInteger, db.ForeignKey('repos.id'), primary_key=True)

    @declared_attr
    def repo(self):
        return db.relationship(Repo, uselist=False)

    cnt_watch = db.Column(db.Integer)


class ReportAllDaily(ReportBase):
    __tablename__ = 'report_all_daily'


class ReportAllWeekly(ReportBase):
    __tablename__ = 'report_all_weekly'

class ReportAllMonthly(ReportBase):
    __tablename__ = 'report_all_monthly'<commit_msg>report lazy load<commit_after>from gitmostwanted.app import db
from gitmostwanted.models.repo import Repo
from sqlalchemy.ext.declarative import declared_attr


class ReportBase(db.Model):
    __abstract__ = True

    @declared_attr
    def id(self):
        return db.Column(db.BigInteger, db.ForeignKey('repos.id'), primary_key=True)

    @declared_attr
    def repo(self):
        return db.relationship(Repo, uselist=False, lazy='joined')

    cnt_watch = db.Column(db.Integer)


class ReportAllDaily(ReportBase):
    __tablename__ = 'report_all_daily'


class ReportAllWeekly(ReportBase):
    __tablename__ = 'report_all_weekly'

class ReportAllMonthly(ReportBase):
    __tablename__ = 'report_all_monthly'
{'fraction_non_alphanumeric': 0.09116809116809117, 'fraction_numerical': 0.0, 'mean_word_length': 4.665322580645161, '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': '5900101', 'n_tokens_mistral': 480, 'n_tokens_neox': 453, 'n_words': 88}