Добавил теханализ
This commit is contained in:
@@ -34,6 +34,7 @@ from .models import (
|
||||
CustomUser,
|
||||
Band,
|
||||
Source,
|
||||
TechAnalyze,
|
||||
)
|
||||
from .filters import (
|
||||
GeoKupDistanceFilter,
|
||||
@@ -1084,3 +1085,79 @@ class SourceAdmin(ImportExportActionModelAdmin, LeafletGeoAdmin, BaseAdmin):
|
||||
)
|
||||
|
||||
autocomplete_fields = ("info",)
|
||||
|
||||
|
||||
@admin.register(TechAnalyze)
|
||||
class TechAnalyzeAdmin(ImportExportActionModelAdmin, BaseAdmin):
|
||||
"""Админ-панель для модели TechAnalyze."""
|
||||
|
||||
list_display = (
|
||||
"name",
|
||||
"satellite",
|
||||
"frequency",
|
||||
"freq_range",
|
||||
"polarization",
|
||||
"bod_velocity",
|
||||
"modulation",
|
||||
"standard",
|
||||
"created_at",
|
||||
"updated_at",
|
||||
)
|
||||
list_display_links = ("name",)
|
||||
list_select_related = (
|
||||
"satellite",
|
||||
"polarization",
|
||||
"modulation",
|
||||
"standard",
|
||||
"created_by__user",
|
||||
"updated_by__user",
|
||||
)
|
||||
|
||||
list_filter = (
|
||||
("satellite", MultiSelectRelatedDropdownFilter),
|
||||
("polarization", MultiSelectRelatedDropdownFilter),
|
||||
("modulation", MultiSelectRelatedDropdownFilter),
|
||||
("standard", MultiSelectRelatedDropdownFilter),
|
||||
("frequency", NumericRangeFilterBuilder()),
|
||||
("freq_range", NumericRangeFilterBuilder()),
|
||||
("created_at", DateRangeQuickSelectListFilterBuilder()),
|
||||
("updated_at", DateRangeQuickSelectListFilterBuilder()),
|
||||
)
|
||||
|
||||
search_fields = (
|
||||
"name",
|
||||
"satellite__name",
|
||||
"frequency",
|
||||
"note",
|
||||
)
|
||||
|
||||
ordering = ("-created_at",)
|
||||
readonly_fields = ("created_at", "created_by", "updated_at", "updated_by")
|
||||
autocomplete_fields = ("satellite", "polarization", "modulation", "standard")
|
||||
|
||||
fieldsets = (
|
||||
(
|
||||
"Основная информация",
|
||||
{"fields": ("name", "satellite", "note")},
|
||||
),
|
||||
(
|
||||
"Технические параметры",
|
||||
{
|
||||
"fields": (
|
||||
"frequency",
|
||||
"freq_range",
|
||||
"polarization",
|
||||
"bod_velocity",
|
||||
"modulation",
|
||||
"standard",
|
||||
)
|
||||
},
|
||||
),
|
||||
(
|
||||
"Метаданные",
|
||||
{
|
||||
"fields": ("created_at", "created_by", "updated_at", "updated_by"),
|
||||
"classes": ("collapse",),
|
||||
},
|
||||
),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user