view.py 410 B

12345678910111213141516171819202122232425
  1. from dataclasses import dataclass
  2. from typing import Optional, List
  3. class View: pass
  4. @dataclass
  5. class UserInvite(View):
  6. claimed: bool
  7. claimant: str
  8. token: str
  9. @dataclass
  10. class AdminPane(View):
  11. invites: List[UserInvite]
  12. @dataclass
  13. class Config(View):
  14. username: str
  15. admin_pane: Optional[AdminPane]
  16. @dataclass
  17. class Page(View):
  18. title: str
  19. content: str
  20. user: Optional[str]