Add pages to Book

This commit is contained in:
2022-07-21 01:08:22 +03:00
parent dac9b94680
commit 22d4aa006d
2 changed files with 31 additions and 0 deletions

View File

@@ -1,4 +1,5 @@
from datetime import date
from typing import Optional
import ormar
from sqlalchemy import text
@@ -150,6 +151,7 @@ class Book(ormar.Model):
is_deleted: bool = ormar.Boolean(
default=False, server_default=text("false"), nullable=False
)
pages: Optional[int] = ormar.Integer(minimum=0, nullable=True) # type: ignore
authors = ormar.ManyToMany(Author, through=BookAuthors)
translators = ormar.ManyToMany(