First commite

This commit is contained in:
Pavel Sobolev
2025-11-12 23:49:00 +03:00
commit c4bb087aaf
28 changed files with 2090 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
from __future__ import annotations
from io import BytesIO
from typing import Any, Dict, Protocol
class ProfileSerializer:
"""Сериализатор данных профиля для рендереров."""
def serialize(self, profile) -> Dict[str, Any]:
return {
"full_name": profile.full_name,
"role": getattr(profile, "role", ""),
"summary": getattr(profile, "summary", ""),
"location": getattr(profile, "location", ""),
"languages": getattr(profile, "languages", []) or [],
"contacts": {
"email": getattr(profile, "email", ""),
"phone": getattr(profile, "phone", ""),
"telegram": getattr(profile, "telegram", ""),
},
"experience": list(profile.experience.all()),
"skills_map": list(profile.skills_map.all()),
}
class Renderer(Protocol):
def render(self, profile) -> BytesIO: ...