mirror of
https://github.com/wowlikon/LibraryAPI.git
synced 2025-12-11 21:30:46 +00:00
Created genre table and added links and endpoints for it.
This commit is contained in:
@@ -1,14 +1,17 @@
|
||||
from .author import Author
|
||||
from .book import Book
|
||||
from .genre import Genre
|
||||
from .links import (
|
||||
AuthorBookLink, GenreBookLink,
|
||||
AuthorWithBooks, BookWithAuthors,
|
||||
GenreWithBooks, BookWithAuthorsAndGenres
|
||||
GenreWithBooks, BookWithGenres,
|
||||
BookWithAuthorsAndGenres
|
||||
)
|
||||
|
||||
__all__ = [
|
||||
'Author', 'Book',
|
||||
'Author', 'Book', 'Genre',
|
||||
'AuthorBookLink', 'AuthorWithBooks',
|
||||
'BookWithAuthors', 'GenreBookLink',
|
||||
'GenreWithBooks', 'BookWithAuthorsAndGenres'
|
||||
'GenreWithBooks', 'BookWithGenres',
|
||||
'BookWithAuthorsAndGenres'
|
||||
]
|
||||
|
||||
@@ -9,6 +9,6 @@ if TYPE_CHECKING:
|
||||
class Genre(GenreBase, table=True):
|
||||
id: Optional[int] = Field(default=None, primary_key=True, index=True)
|
||||
books: List["Book"] = Relationship(
|
||||
back_populates="authors",
|
||||
back_populates="genres",
|
||||
link_model=GenreBookLink
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user