Untitled

mail@pastecode.io avatar
unknown
python
2 years ago
830 B
2
Indexable
Never
import datetime
import enum
import uuid
from enum import Enum
from datetime import date

class NoteValue(Enum):

    TWO_ZERO = '2.0'
    TWO_HALF = '2.5'


class Note:

    def __init__(self, note_value: str, exam_type: str, term: str, uuid: object, date: object):

        self.note_value = Enum('NoteValue', ['2.0', '2.5'])
        self.exam_type = Enum('ExamType', ['TEST', 'EXAM', 'PASS', 'PROJECT'])
        self.term = Enum('Term', ['FIRST', 'SECOND', 'THIRD', 'BOARD_EXAM'])
        self.uuid = uuid
        self.date = date

    def __repr__(self):
        return f"Note: UUID({uuid.uuid4()}), value: {self.note_value.name}, type of exam: {self.exam_type}, " \
               f"term: {self.term}, date: {self.date}"


objNote = Note('2.0', 'TEST', 'FIRST', uuid=uuid.uuid4(), date=date.today())

print(objNote.__repr__())