Код: Выделить всё
class Database:
def __init__(self, db_file: str):
"""
Initialize database.
:param db_file: Path to database file.
"""
self.db_file = db_file
self.user = UserRepository(db_file)
self.suggestion = SuggestionRepository(db_file)
self.admin_action = AdminActionRepository(db_file)
Код: Выделить всё
class UserRepository:
def __init__(self, db):
self.db = db
self.lock = asyncio.Lock()
async def create(self, user_id, first_name, last_name):
pass
Я попробовал этот метод:
Код: Выделить всё
self.user: UserRepository = UserRepository(db_file)
self.suggestion: SuggestionRepository = SuggestionRepository(db_file)
self.admin_action: AdminActionRepository = AdminActionRepository(db_file)
Код: Выделить всё
db.user.UserRepository.create()Подробнее здесь: https://stackoverflow.com/questions/791 ... ith-vscode
Мобильная версия