12345678910111213141516171819202122 |
- from dataclasses import dataclass
- import datetime
- class View:
- pass
- @dataclass
- class Page:
- title: str
- slug: str
- modified: datetime.datetime
- source: str
- rendered: str
- def to_dict(self) -> dict:
- return {
- "title": self.title,
- "slug": self.slug,
- "modified": self.modified.timestamp(),
- "source": self.source,
- "rendered": self.rendered,
- }
|