Add Book model class

- Init models.py
- Add Book class
This commit is contained in:
trueold89 2024-07-19 21:01:35 +03:00
parent a45fb3992e
commit 4f6aa01202
Signed by: trueold89
GPG Key ID: C122E85DD49E6B30
1 changed files with 31 additions and 0 deletions

31
openbookr/models.py Normal file
View File

@ -0,0 +1,31 @@
# -*- coding: utf-8 -*-
#######################
# Classes description #
#######################
from collections.abc import Iterable
from pydantic import BaseModel as BM
class Book(BM):
"""
Book model class
"""
def __init__(self, name: str, hashkey: str) -> None:
"""
:param name: Book title
:param hashkey: Book file hash
"""
self.name = name
self.hashkey = hashkey
name: str
hashkey: str
author: str | None = None
description: str | None = None
mark: float | None = None
read_flag: bool = False
tags: Iterable = ()
genres: Iterable = ()