mirror of
https://github.com/koloideal/Quizzi.git
synced 2026-06-10 10:25:28 +03:00
Initial commit
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
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,
|
||||
)
|
||||
Reference in New Issue
Block a user