Skip to content
This repository has been archived by the owner on Sep 27, 2024. It is now read-only.

Commit

Permalink
Remove Any type
Browse files Browse the repository at this point in the history
  • Loading branch information
msathieu committed Feb 28, 2024
1 parent fcd1b31 commit f810d0a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions backend/db/models/models.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
from abc import abstractmethod
from dataclasses import dataclass
from datetime import datetime
from typing import Any
from typing import Generic, TypeVar

from sqlalchemy import Column, ForeignKey, Table
from sqlalchemy.orm import Mapped, mapped_column, relationship

from db.extensions import Base
from domain.models.AdminDataclass import AdminDataclass
from domain.models.base_model import JsonRepresentable
from domain.models.GroupDataclass import GroupDataclass
from domain.models.ProjectDataclass import ProjectDataclass
from domain.models.StudentDataclass import StudentDataclass
Expand All @@ -16,11 +17,12 @@
from domain.models.TeacherDataclass import TeacherDataclass
from domain.models.UserDataclass import UserDataclass

D = TypeVar("D", bound=JsonRepresentable)

@dataclass()
class AbstractModel:
class AbstractModel(Generic[D]):
@abstractmethod
def to_domain_model(self) -> Any:
def to_domain_model(self) -> D:
pass


Expand Down

0 comments on commit f810d0a

Please sign in to comment.