MyReadings/Book.py
2024-08-05 21:18:49 +02:00

17 lines
572 B
Python

class Book:
def __init__(self, name: str, description: str, image: str, review: str) -> None:
self.name: str = name
self.description: str = description
self.image: str = image
self.review: str = review
def to_html(self) -> str:
return f"""
<tr>
<td class="name">{self.name}</td>
<td class="description">{self.description}</td>
<td class="image"><img src="img/{self.image}"></td>
<td class="review">{self.review}</td>
</tr>
"""