-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtables.py
65 lines (50 loc) · 2.26 KB
/
tables.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
from utils import db
from sqlalchemy import inspect
class Application(db.Model):
__tablename__ = "applications"
id = db.Column(db.Integer, primary_key=True)
date = db.Column(db.String)
user_id = db.Column(db.String)
is_inhouse_posting = db.Column(db.Boolean)
status = db.Column(db.String(256))
resume = db.Column(db.String(256))
comment = db.Column(db.String(256))
inhouse = db.relationship("Inhouse", backref="applications", lazy=True)
external = db.relationship("External", backref="applications", lazy=True)
interviewquestions = db.relationship("InterviewQuestion", backref="applications", lazy=True)
def __repr__(self):
return '<Application %r>' % self.id
def to_dict(self):
return { c.key: getattr(self, c.key) for c in inspect(self).mapper.column_attrs }
class Inhouse(db.Model):
__tablename__ = "inhouse"
id = db.Column(db.Integer, primary_key=True)
application_id = db.Column(db.Integer, db.ForeignKey('applications.id'))
job_id = db.Column(db.String(256))
def __repr__(self):
return '<Inhouse Application %r>' % self.id
def to_dict(self):
return { c.key: getattr(self, c.key) for c in inspect(self).mapper.column_attrs }
class External(db.Model):
__tablename__ = "external"
id = db.Column(db.Integer, primary_key=True)
application_id = db.Column(db.Integer, db.ForeignKey('applications.id'))
url = db.Column(db.String(256))
position = db.Column(db.String(256))
company = db.Column(db.String(256))
date_posted = db.Column(db.String(256))
deadline = db.Column(db.String(256))
def __repr__(self):
return '<External Application %r>' % self.id
def to_dict(self):
return { c.key: getattr(self, c.key) for c in inspect(self).mapper.column_attrs }
class InterviewQuestion(db.Model):
__tablename__ = "interviewquestions"
id = db.Column(db.Integer, primary_key=True)
application_id = db.Column(db.Integer, db.ForeignKey('applications.id'))
title = db.Column(db.String(256))
question = db.Column(db.String(256))
def __repr__(self):
return '<Interview Question %r' % self.Question
def to_dict(self):
return { c.key: getattr(self, c.key) for c in inspect(self).mapper.column_attrs }