added test.py
parent
37c1421d22
commit
bf44bfe200
@ -0,0 +1,11 @@
|
|||||||
|
from calibrestekje import Book, Publisher, init_session
|
||||||
|
|
||||||
|
session = init_session("sqlite:///metadata.db")
|
||||||
|
|
||||||
|
publisher = (session.query(Publisher)
|
||||||
|
.filter(Publisher.name == "MIT Press").one())
|
||||||
|
|
||||||
|
books = (session.query(Book)
|
||||||
|
.filter(Book.publishers.contains(publisher)))
|
||||||
|
|
||||||
|
print(f"Books published by MIT Press: {books.count()}")
|
Loading…
Reference in New Issue