-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodels.py
More file actions
30 lines (26 loc) · 1.02 KB
/
models.py
File metadata and controls
30 lines (26 loc) · 1.02 KB
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
from flask_sqlalchemy import SQLAlchemy
from flask_login import UserMixin
db = SQLAlchemy()
class User(UserMixin, db.Model):
id = db.Column(db.Integer, primary_key=True)
username = db.Column(db.String(150), unique=True, nullable=False)
password_hash = db.Column(db.String(200), nullable=False)
class Resume(db.Model):
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(200))
email = db.Column(db.String(200))
education = db.Column(db.Text)
skills = db.Column(db.Text)
experience = db.Column(db.Text)
resume_file = db.Column(db.String(300))
raw_text = db.Column(db.Text)
def to_dict(self):
return {
'id': self.id,
'name': self.name or 'Not Mentioned',
'email': self.email or 'Not Mentioned',
'education': self.education or 'Not Mentioned',
'skills': self.skills or 'Not Mentioned',
'experience': self.experience or 'Not Mentioned',
'resume_file': self.resume_file or ''
}