Files
social-graph/backend/core/views.py
T
gitrusprusandCursor cafc7335ad Add plugin platform with modular backend and frontend registry.
Split graph/import/meta into Django apps, add API v1 with OpenAPI and pytest, and introduce plugin registry with the tags reference plugin on both FE and BE.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-25 09:35:51 +03:00

31 lines
832 B
Python

from rest_framework.decorators import api_view
from rest_framework.response import Response
from .choices import (
RELATION_TYPES,
LIFE_SPHERES,
NETWORK_CIRCLES,
INTERACTION_INTENSITY,
choices_payload,
)
@api_view(['GET'])
def meta_choices(request):
"""Unified meta endpoint for all domain enums."""
return Response(choices_payload())
@api_view(['GET'])
def relation_types(request):
return Response([{'value': v, 'label': l} for v, l in RELATION_TYPES])
@api_view(['GET'])
def network_map_choices(request):
return Response({
'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],
})