<commit_before># -*- coding: utf-8 -*-

from sqlalchemy import func, and_, distinct, asc, Integer, String, Text, Date
from sqlalchemy.ext.hybrid import hybrid_property, hybrid_method
from sqlalchemy.orm import aliased,relationship
from sqlalchemy.orm.exc import MultipleResultsFound, NoResultFound

from ..helpers import image_url, utc_from_local
from ..base_resources import AbstractLang
from ..cacher import cacher
from ..invests.models import Invest

from .. import db

class CallLang(AbstractLang, db.Model):
    __tablename__ = 'call_lang'

    id = db.Column('id', String(50), db.ForeignKey('call.id'), primary_key=True)
    lang = db.Column('lang', String(2), primary_key=True)
    name = db.Column('name', String(100))
    subtitle = db.Column('subtitle', Text)
    description = db.Column('description', Text)
    legal = db.Column('legal', Text)
    whom = db.Column('whom', Text)
    applies = db.Column('apply', Text)
    dossier = db.Column('dossier', Text)
    tweet = db.Column('tweet', Text)
    resources = db.Column('resources', Text)
    pending = db.Column('pending', Integer)
    call = relationship('Call', back_populates='translations')

    def __repr__(self):
        return '<CallLang %s(%s): %r>' % (self.id, self.lang, self.name)

class Call(db.Model):
    __tablename__ = 'call'

    #CALL STATUS IDs
    STATUS_PENDING   = 0
    STATUS_EDITING    = 1
    STATUS_REVIEWING  = 2
    STATUS_APPLYING   = 3
    STATUS_PUBLISHED  = 4
    STATUS_SUCCEEDED  = 5
    STATUS_EXPIRED    = 6
    STATUS_STR = ('pending', 'editing', 'reviewing', 'applying', 'published', 'succeeded', 'expired')

    PUBLIC_CALLS = [STATUS_REVIEWING, STATUS_APPLYING, STATUS_PUBLISHED, STATUS_SUCCEEDED, STATUS_EXPIRED]

    SCOPES_STR = ('', 'local', 'regional', 'national', 'global')

    id = db.Column('id', String(50), primary_key=True)
    name = db.Column('name', Text)
    subtitle = db.Column('subtitle', Text)
    description = db.Column('description', Text)
    user_id = db.Column('owner', String(50), db.ForeignKey('user.id'))
    whom = db.Column('whom', Text)
    applies = db.Column('apply', Text)
    legal = db.Column('legal', Text)
    dossier = db.Column('dossier', Text)
    amount_available = db.Column('amount', Integer, nullable=False) # Total available amount
    amount_remaining = db.Column('rest', Integer, nullable=False) # Total Amount remaining to distribute<commit_msg>fix review status for calls<commit_after># -*- coding: utf-8 -*-

from sqlalchemy import func, and_, distinct, asc, Integer, String, Text, Date
from sqlalchemy.ext.hybrid import hybrid_property, hybrid_method
from sqlalchemy.orm import aliased,relationship
from sqlalchemy.orm.exc import MultipleResultsFound, NoResultFound

from ..helpers import image_url, utc_from_local
from ..base_resources import AbstractLang
from ..cacher import cacher
from ..invests.models import Invest

from .. import db

class CallLang(AbstractLang, db.Model):
    __tablename__ = 'call_lang'

    id = db.Column('id', String(50), db.ForeignKey('call.id'), primary_key=True)
    lang = db.Column('lang', String(2), primary_key=True)
    name = db.Column('name', String(100))
    subtitle = db.Column('subtitle', Text)
    description = db.Column('description', Text)
    legal = db.Column('legal', Text)
    whom = db.Column('whom', Text)
    applies = db.Column('apply', Text)
    dossier = db.Column('dossier', Text)
    tweet = db.Column('tweet', Text)
    resources = db.Column('resources', Text)
    pending = db.Column('pending', Integer)
    call = relationship('Call', back_populates='translations')

    def __repr__(self):
        return '<CallLang %s(%s): %r>' % (self.id, self.lang, self.name)

class Call(db.Model):
    __tablename__ = 'call'

    #CALL STATUS IDs
    STATUS_PENDING   = 0
    STATUS_EDITING    = 1
    STATUS_REVIEWING  = 2
    STATUS_APPLYING   = 3
    STATUS_PUBLISHED  = 4
    STATUS_SUCCEEDED  = 5
    STATUS_EXPIRED    = 6
    STATUS_STR = ('pending', 'editing', 'reviewing', 'applying', 'published', 'succeeded', 'expired')

    PUBLIC_CALLS = [STATUS_APPLYING, STATUS_PUBLISHED, STATUS_SUCCEEDED, STATUS_EXPIRED]

    SCOPES_STR = ('', 'local', 'regional', 'national', 'global')

    id = db.Column('id', String(50), primary_key=True)
    name = db.Column('name', Text)
    subtitle = db.Column('subtitle', Text)
    description = db.Column('description', Text)
    user_id = db.Column('owner', String(50), db.ForeignKey('user.id'))
    whom = db.Column('whom', Text)
    applies = db.Column('apply', Text)
    legal = db.Column('legal', Text)
    dossier = db.Column('dossier', Text)
    amount_available = db.Column('amount', Integer, nullable=False) # Total available amount
    amount_remaining = db.Column('rest', Integer, nullable=False) # Total Amount remaining to distribute
{'fraction_non_alphanumeric': 0.13979166666666668, 'fraction_numerical': 0.0075, 'mean_word_length': 4.107446808510638, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '628207', 'n_tokens_mistral': 1632, 'n_tokens_neox': 1541, 'n_words': 380}