Добавил альтернативное имя у спутника

This commit is contained in:
2025-12-01 12:19:24 +03:00
parent 01871c3e13
commit c72bf12d41
14 changed files with 720 additions and 220 deletions

View File

@@ -124,10 +124,11 @@ class SatelliteListView(LoginRequiredMixin, View):
except (ValueError, TypeError):
pass
# Search by name
# Search by name, alternative_name, or comment
if search_query:
satellites = satellites.filter(
Q(name__icontains=search_query) |
Q(alternative_name__icontains=search_query) |
Q(comment__icontains=search_query)
)
@@ -137,6 +138,8 @@ class SatelliteListView(LoginRequiredMixin, View):
"-id": "-id",
"name": "name",
"-name": "-name",
"alternative_name": "alternative_name",
"-alternative_name": "-alternative_name",
"norad": "norad",
"-norad": "-norad",
"international_code": "international_code",
@@ -169,6 +172,7 @@ class SatelliteListView(LoginRequiredMixin, View):
processed_satellites.append({
'id': satellite.id,
'name': satellite.name or "-",
'alternative_name': satellite.alternative_name or "-",
'norad': satellite.norad if satellite.norad else "-",
'international_code': satellite.international_code or "-",
'bands': ", ".join(band_names) if band_names else "-",