application.py 365 B

1234567891011121314
  1. from typing import Optional
  2. from clean_python import InMemoryGateway
  3. from clean_python import Manage
  4. from .domain import Book
  5. from .domain import BookRepository
  6. class ManageBook(Manage[Book]):
  7. def __init__(self, repo: Optional[BookRepository] = None):
  8. if repo is None:
  9. repo = BookRepository(InMemoryGateway([]))
  10. self.repo = repo