Exemple #1
0
class Skill(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    person_id = db.Column(db.Integer, db.ForeignKey('person.id'), index=True)
    classifier_id = db.Column(db.Integer,
                              db.ForeignKey('classifier.id'),
                              index=True)

    def __repr__(self):
        return '<Skill %d>' % self.id
Exemple #2
0
class Document(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    created = db.Column(db.DateTime)
    person_id = db.Column(db.Integer, db.ForeignKey('person.id'), index=True)
    type = db.Column(db.String(255))
    name = db.Column(db.String(255))

    def __init__(self, created=None, person_id=None, type='', name=''):
        self.created = created
        self.person_id = person_id
        self.type = type
        self.name = name

    def __repr__(self):
        return '<Document %d>' % self.id
Exemple #3
0
class Classifier(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    category = db.Column(db.String(255), index=True)
    tag_lv = db.Column(db.String(255), index=True)
    tag_en = db.Column(db.String(255), index=True)
    tag_ru = db.Column(db.String(255), index=True)
    skills = db.relationship('Skill', backref='classifier', lazy='dynamic')

    def __init__(self, category='', tag_en='', tag_lv='', tag_ru=''):
        self.category = category
        self.tag_en = tag_en
        self.tag_lv = tag_lv
        self.tag_ru = tag_ru

    def __repr__(self):
        return '<Classifier %d>' % self.id
Exemple #4
0
class Person(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    created = db.Column(db.DateTime)
    modified = db.Column(db.DateTime)
    name = db.Column(db.String(255), index=True)
    surname = db.Column(db.String(255), index=True)
    nickname = db.Column(db.String(255))
    pcode = db.Column(db.String(255))
    contract_nr = db.Column(db.String(255))
    #birthdate = db.Column(db.String(255))
    birthdate = db.Column(db.Date)
    my_phone_code = db.Column(db.String(255))
    my_phone = db.Column(db.String(255))
    email = db.Column(db.String(255))
    other_phone_code = db.Column(db.String(255))
    other_phone = db.Column(db.String(255))
    home_address = db.Column(db.String(255))
    height = db.Column(db.Integer)
    foot_size = db.Column(db.Integer)
    cloth_size = db.Column(db.String(255))
    voice = db.Column(db.String(255))
    contact_lenses = db.Column(db.Boolean)
    be_dressed = db.Column(db.Boolean)
    profile_image = db.Column(db.String(255))
    is_active = db.Column(db.Boolean)  # inactive by default
    species = db.Column(db.String(255))  # 1-man, 2-woman, 3- animal
    mother_phone_code = db.Column(db.String(255))
    mother_phone = db.Column(db.String(255))
    mother_name = db.Column(db.String(255))
    father_phone_code = db.Column(db.String(255))
    father_phone = db.Column(db.String(255))
    father_name = db.Column(db.String(255))
    speciality = db.Column(db.String(255))
    experience = db.Column(db.String(1000))
    cv = db.Column(db.String(255))
    current_occupation = db.Column(db.String(255))
    workplace = db.Column(db.String(255))
    play_age_from = db.Column(db.Integer)
    play_age_to = db.Column(db.Integer)

    skills = db.relationship('Skill', backref='person', lazy='dynamic')
    documents = db.relationship('Document', backref='document', lazy='dynamic')

    def __init__(self,
                 created=None,
                 modified=None,
                 name='',
                 surname='',
                 nickname='',
                 pcode='',
                 contract_nr='',
                 birthdate='',
                 my_phone_code='',
                 my_phone='',
                 email='',
                 other_phone_code='',
                 other_phone='',
                 home_address='',
                 height='',
                 foot_size='',
                 cloth_size='',
                 voice='',
                 contact_lenses=False,
                 be_dressed=False,
                 profile_image=None,
                 is_active=False,
                 species='',
                 mother_phone_code='',
                 mother_phone='',
                 mother_name='',
                 father_phone_code='',
                 father_phone='',
                 father_name='',
                 speciality='',
                 experience='',
                 cv=None,
                 current_occupation=None,
                 workplace=None,
                 play_age_from='',
                 play_age_to=''):
        self.created = created
        self.modified = modified
        self.name = name
        self.surname = surname
        self.nickname = nickname
        self.pcode = pcode
        self.contract_nr = contract_nr
        self.birthdate = birthdate
        self.my_phone_code = my_phone_code
        self.my_phone = my_phone
        self.email = email
        self.other_phone_code = other_phone_code
        self.other_phone = other_phone
        self.home_address = home_address
        self.height = height
        self.foot_size = foot_size
        self.cloth_size = cloth_size
        self.voice = voice
        self.contact_lenses = contact_lenses
        self.be_dressed = be_dressed
        self.profile_image = profile_image
        self.is_active = is_active
        self.species = species
        self.mother_phone_code = mother_phone_code
        self.mother_phone = mother_phone
        self.mother_name = mother_name
        self.father_phone_code = father_phone_code
        self.father_phone = father_phone
        self.father_name = father_name
        self.speciality = speciality
        self.experience = experience
        self.cv = cv
        self.current_occupation = current_occupation
        self.workplace = workplace
        self.play_age_from = play_age_from
        self.play_age_to = play_age_to

    def __repr__(self):
        return '<Person %d>' % self.id