Spaces:
Sleeping
Sleeping
File size: 1,380 Bytes
3d015cd | 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 | """Student data model"""
from typing import Optional
from dataclasses import dataclass
@dataclass
class Student:
student_id: str
user_id: Optional[str]
cgpa: float
sgpa_sem1: Optional[float]
sgpa_sem2: Optional[float]
sgpa_sem3: Optional[float]
sgpa_sem4: Optional[float]
sgpa_sem5: Optional[float]
sgpa_sem6: Optional[float]
sgpa_sem7: Optional[float]
sgpa_sem8: Optional[float]
tenth_pct: Optional[float]
twelfth_pct: Optional[float]
extracurricular_text: Optional[str] = None
certifications_text: Optional[str] = None
internship_text: Optional[str] = None
def to_dict(self):
return {
'student_id': self.student_id,
'user_id': self.user_id,
'cgpa': self.cgpa,
'sgpa_sem1': self.sgpa_sem1,
'sgpa_sem2': self.sgpa_sem2,
'sgpa_sem3': self.sgpa_sem3,
'sgpa_sem4': self.sgpa_sem4,
'sgpa_sem5': self.sgpa_sem5,
'sgpa_sem6': self.sgpa_sem6,
'sgpa_sem7': self.sgpa_sem7,
'sgpa_sem8': self.sgpa_sem8,
'tenth_pct': self.tenth_pct,
'twelfth_pct': self.twelfth_pct,
'extracurricular_text': self.extracurricular_text,
'certifications_text': self.certifications_text,
'internship_text': self.internship_text
}
|