Files
social-graph/backend/core/choices.py
T
gitrusprusandCursor e80d0d0e88 Add settings page and configurable network map types.
Let users define sector/circle labels and geometry per map type, choose a type when creating maps, and sync types through local backup and API migrations.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-25 10:45:34 +03:00

50 lines
1.4 KiB
Python

"""Shared domain choice constants for API meta and models."""
LIFE_SPHERES = [
('work', 'Работа'),
('study', 'Учёба'),
('hobby', 'Хобби'),
('family', 'Семья'),
('health', 'Здоровье'),
('other', 'Другое'),
]
NETWORK_CIRCLES = [
('support', 'Круг поддержки'),
('productivity', 'Круг продуктивности'),
('development', 'Круг развития'),
]
INTERACTION_INTENSITY = [
('intense', 'Интенсивные контакты'),
('periodic', 'Периодические контакты'),
('sparse', 'Редкие контакты'),
]
RELATION_TYPES = [
('colleague', 'Коллега'),
('friend', 'Друг'),
('family', 'Родственник'),
('acquaintance', 'Знакомый'),
('business', 'Деловой партнёр'),
('other', 'Другое'),
]
def choices_payload():
return {
'relation_types': [{'value': v, 'label': l} for v, l in RELATION_TYPES],
'life_spheres': [{'value': v, 'label': l} for v, l in LIFE_SPHERES],
'network_circles': [{'value': v, 'label': l} for v, l in NETWORK_CIRCLES],
'interaction_intensities': [{'value': v, 'label': l} for v, l in INTERACTION_INTENSITY],
}
DEFAULT_MAP_TYPE_SECTORS = [
{'key': v, 'label': l} for v, l in LIFE_SPHERES
]
DEFAULT_MAP_TYPE_CIRCLES = [
{'key': v, 'label': l} for v, l in NETWORK_CIRCLES
]