25 lines
1015 B
Python
25 lines
1015 B
Python
class Book:
|
|
|
|
def __init__(self, name: str, author: str, description: str, image: str, review: str, release_date: str, reading_date: str) -> None:
|
|
self.name: str = name
|
|
self.description: str = description
|
|
self.image: str = image
|
|
self.review: str = review
|
|
self.release_date: str = release_date
|
|
self.reading_date: str = reading_date
|
|
self.author: str = author
|
|
|
|
def to_html(self) -> str:
|
|
return f"""
|
|
<tr>
|
|
<td class="image-div"><img src="img/{self.image}"></td>
|
|
<td class="namedesc-div">
|
|
<p class="author">{self.author}</p>
|
|
<p class="name">{self.name}</p>
|
|
<p class="description">{self.description}</p>
|
|
<p class="release-date">{self.release_date}</p>
|
|
</td>
|
|
<td class="review-div">{self.review}</td>
|
|
<td class="reading-date">{self.reading_date}</td>
|
|
</tr>
|
|
""" |