MyReadings/Book.py

17 lines
572 B
Python
Raw Normal View History

2024-08-05 15:14:49 -04:00
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>
2024-08-05 15:18:49 -04:00
<td class="image"><img src="img/{self.image}"></td>
2024-08-05 15:14:49 -04:00
<td class="review">{self.review}</td>
</tr>
"""