Files
ormar/ormar/protocols/relation_protocol.py
2020-11-01 18:26:01 +07:00

18 lines
439 B
Python

from typing import TYPE_CHECKING, Type, Union
try:
from typing import Protocol
except ImportError: # pragma: nocover
from typing_extensions import Protocol # type: ignore
if TYPE_CHECKING: # pragma: nocover
from ormar import Model
class RelationProtocol(Protocol): # pragma: nocover
def add(self, child: "Model") -> None:
...
def remove(self, child: Union["Model", Type["Model"]]) -> None:
...