add enum class

This commit is contained in:
WorldTeacher
2024-01-31 15:30:50 +01:00
parent 69e7d7a0de
commit 4ff37d9452

View File

@@ -1,6 +1,6 @@
import re
from dataclasses import dataclass, field
from enum import Enum
@dataclass
class ApparatData:
@@ -74,3 +74,44 @@ class MailData:
body: str | None = None
mailto: str | None = None
prof: str | None = None
class Subjects(Enum):
BIOLOGY = (1, "Biologie")
CHEMISTRY = (2, "Chemie")
GERMAN = (3, "Deutsch")
ENGLISH = (4, "Englisch")
PEDAGOGY = (5, "Erziehungswissenschaft")
FRENCH = (6, "Französisch")
GEOGRAPHY = (7, "Geographie")
HISTORY = (8, "Geschichte")
HEALT_EDUCATION = (9, "Gesundheitspädagogik")
HTW = (10, "Haushalt / Textil")
ART = (11, "Kunst")
MATH_IT = (12, "Mathematik / Informatik")
MEDIAPEDAGOGY = (13, "Medien in der Bildung")
MUSIC = (14, "Musik")
PHILOSOPHY = (15, "Philosophie")
PHYSICS = (16, "Physik")
POLITICS = (17, "Politikwissenschaft")
PRORECTORATE = (18, "Prorektorat Lehre und Studium")
PSYCHOLOGY = (19, "Psychologie")
SOCIOLOGY = (20, "Soziologie")
SPORT = (21, "Sport")
TECHNIC = (22, "Technik")
THEOLOGY = (23, "Theologie")
ECONOMICS = (24, "Wirtschaftslehre")
@property
def id(self):
return self.value[0]
@property
def name(self):
return self.value[1]
@classmethod
def get_index(cls, name):
for i in cls:
if i.name == name:
return i.id -1