Skip to content

Instantly share code, notes, and snippets.

@picaso
picaso / base_repo.py
Last active August 1, 2021 07:11
Repository pattern
from typing import Generic, TypeVar, Optional, List
from sqlalchemy.exc import SQLAlchemyError
from db.postgres_db.db_manager import DBManager
from db.postgres_db.models import db
T = TypeVar('T', bound=db.Model)