Source code for telegram_bot_discussion.ext.pagination.dao.item

from abc import ABC, abstractmethod
from typing import Any, List


[docs] class Item(ABC):
[docs] @abstractmethod def get_id(self, *args, **kwargs): raise Exception("Must realize `get_id()`")
[docs] @abstractmethod def item(self, *args, **kwargs) -> str: raise Exception("Must realize `item()`")
[docs] @classmethod @abstractmethod def page(cls, query: Any, page: int, *args, **kwargs) -> List["Item"]: raise Exception("Must realize `page()`")
[docs] @classmethod @abstractmethod def is_page_exist(cls, query: Any, page: int, *args, **kwargs) -> bool: raise Exception("Must realize `is_page_exist()`")