mirror of
https://github.com/koloideal/Quizzi.git
synced 2026-06-10 10:25:28 +03:00
18 lines
593 B
Python
18 lines
593 B
Python
from trudex.domain.schemas import Question as DomainQuestion
|
|
from trudex.infrastructure.database.models import Question as QuestionModel
|
|
|
|
|
|
class QuestionDTO:
|
|
def __init__(self, model: QuestionModel) -> None:
|
|
self.model: QuestionModel = model
|
|
|
|
def to_domain(self) -> DomainQuestion:
|
|
return DomainQuestion(
|
|
id=self.model.id,
|
|
test_id=self.model.test_id,
|
|
text=self.model.text,
|
|
position=self.model.position,
|
|
question_type=self.model.question_type.value,
|
|
tg_file_id=self.model.tg_file_id,
|
|
)
|