add university_projects field

This commit is contained in:
Sina Atalay 2023-11-27 20:19:30 +01:00
parent a1b61d3ba0
commit 48e31fdad4
4 changed files with 32 additions and 3 deletions

View File

@ -1248,6 +1248,11 @@ class CurriculumVitae(BaseModel):
title="Academic Projects", title="Academic Projects",
description="The academic project entries of the person.", description="The academic project entries of the person.",
) )
university_projects: Optional[list[NormalEntry]] = Field(
default=None,
title="University Projects",
description="The university project entries of the person.",
)
personal_projects: Optional[list[NormalEntry]] = Field( personal_projects: Optional[list[NormalEntry]] = Field(
default=None, default=None,
title="Personal Projects", title="Personal Projects",
@ -1375,6 +1380,7 @@ class CurriculumVitae(BaseModel):
"Publications": self.publications, "Publications": self.publications,
"Projects": self.projects, "Projects": self.projects,
"Academic Projects": self.academic_projects, "Academic Projects": self.academic_projects,
"University Projects": self.university_projects,
"Personal Projects": self.personal_projects, "Personal Projects": self.personal_projects,
"Certificates": self.certificates, "Certificates": self.certificates,
"Extracurricular Activities": self.extracurricular_activities, "Extracurricular Activities": self.extracurricular_activities,
@ -1387,7 +1393,9 @@ class CurriculumVitae(BaseModel):
"Programming Skills": self.programming_skills, "Programming Skills": self.programming_skills,
} }
section_order_is_given = True
if self.section_order is None: if self.section_order is None:
section_order_is_given = False
# If the user didn't specify the section order, then use the default order: # If the user didn't specify the section order, then use the default order:
self.section_order = list(pre_defined_sections.keys()) self.section_order = list(pre_defined_sections.keys())
if self.custom_sections is not None: if self.custom_sections is not None:
@ -1404,6 +1412,13 @@ class CurriculumVitae(BaseModel):
# Create a section for each section name in the section order: # Create a section for each section name in the section order:
if section_name in pre_defined_sections: if section_name in pre_defined_sections:
if pre_defined_sections[section_name] is None: if pre_defined_sections[section_name] is None:
if section_order_is_given:
raise ValueError(
f'The section "{section_name}" is not found in the CV.'
" Please create the section or delete it from the section"
" order."
)
else:
continue continue
entry_type = pre_defined_sections[section_name][0].__class__.__name__ entry_type = pre_defined_sections[section_name][0].__class__.__name__

View File

@ -456,6 +456,19 @@
} }
] ]
}, },
"university_projects": {
"default": null,
"description": "The university project entries of the person.",
"title": "University Projects",
"allOf": [
{
"items": {
"$ref": "#/$defs/NormalEntry"
},
"type": "array"
}
]
},
"personal_projects": { "personal_projects": {
"default": null, "default": null,
"description": "The personal project entries of the person.", "description": "The personal project entries of the person.",
@ -1676,6 +1689,7 @@
"social_networks": null, "social_networks": null,
"summary": null, "summary": null,
"test_scores": null, "test_scores": null,
"university_projects": null,
"website": null, "website": null,
"work_experience": null "work_experience": null
}, },

View File

@ -109,7 +109,7 @@
\LenToUnit{\paperwidth-1.35 cm-0.2 cm+0.05cm}, \LenToUnit{\paperwidth-1.35 cm-0.2 cm+0.05cm},
\LenToUnit{\paperheight-0.675 cm} \LenToUnit{\paperheight-0.675 cm}
){\vtop{{\null}\makebox[0pt][c]{ ){\vtop{{\null}\makebox[0pt][c]{
\small\color{gray}\textit{Last updated on REPLACETHISWITHTODAY}\hspace{\widthof{Last updated on REPLACETHISWITHTODAY}} \small\color{gray}\textit{Last updated on November 27, 2023}\hspace{\widthof{Last updated on November 27, 2023}}
}}}% }}}%
}% }%
}% }%
@ -356,7 +356,7 @@
\vspace{0.07 cm} \vspace{0.07 cm}
A. 1, \textbf{\textit{J. Doe}}, A. 3 A. \nolinebreak 1, J. \nolinebreak Doe, A. \nolinebreak 3
\vspace{0.07 cm} \vspace{0.07 cm}