-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmodels.py
More file actions
47 lines (38 loc) · 1.41 KB
/
models.py
File metadata and controls
47 lines (38 loc) · 1.41 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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
from django.db import models
class ApplicationText(models.Model):
"""
Stores the raw, free-form text for a SINGLE application.
This is our "landing zone" for Oleeo data.
"""
vacancy = models.ForeignKey(
"vacancies.Vacancy",
on_delete=models.CASCADE,
related_name="application_texts"
)
application_id = models.IntegerField(unique=True)
personal_statement = models.TextField(blank=True, null=True)
employment_history = models.TextField(blank=True, null=True)
previous_skill_experience = models.TextField(blank=True, null=True)
def __str__(self):
return f"Application text for {self.application_id}"
class VacancyTextAggregate(models.Model):
"""
Stores all application text AGGREGATED up to a single vacancy.
This is our "reporting" model.
"""
vacancy = models.OneToOneField(
"vacancies.Vacancy",
on_delete=models.CASCADE,
primary_key=True,
related_name="aggregated_text"
)
all_personal_statements = models.TextField(blank=True)
all_employment_history = models.TextField(blank=True)
all_previous_skills = models.TextField(blank=True)
skills_extracted = models.BooleanField(
default=False,
db_index=True,
help_text="True if this text has been processed by the skills-worker."
)
def __str__(self):
return f"Aggregated text for {self.vacancy.pk}"