Переделал страницу с ObjItem. Теперь работает корректно.
This commit is contained in:
@@ -915,6 +915,7 @@ class ObjItemListView(LoginRequiredMixin, View):
|
||||
objects = (
|
||||
ObjItem.objects.select_related(
|
||||
"geo_obj",
|
||||
"source",
|
||||
"updated_by__user",
|
||||
"created_by__user",
|
||||
"lyngsat_source",
|
||||
@@ -933,6 +934,7 @@ class ObjItemListView(LoginRequiredMixin, View):
|
||||
else:
|
||||
objects = ObjItem.objects.select_related(
|
||||
"geo_obj",
|
||||
"source",
|
||||
"updated_by__user",
|
||||
"created_by__user",
|
||||
"lyngsat_source",
|
||||
@@ -1021,14 +1023,14 @@ class ObjItemListView(LoginRequiredMixin, View):
|
||||
)
|
||||
|
||||
if has_kupsat == "1":
|
||||
objects = objects.filter(geo_obj__coords_kupsat__isnull=False)
|
||||
objects = objects.filter(source__coords_kupsat__isnull=False)
|
||||
elif has_kupsat == "0":
|
||||
objects = objects.filter(geo_obj__coords_kupsat__isnull=True)
|
||||
objects = objects.filter(source__coords_kupsat__isnull=True)
|
||||
|
||||
if has_valid == "1":
|
||||
objects = objects.filter(geo_obj__coords_valid__isnull=False)
|
||||
objects = objects.filter(source__coords_valid__isnull=False)
|
||||
elif has_valid == "0":
|
||||
objects = objects.filter(geo_obj__coords_valid__isnull=True)
|
||||
objects = objects.filter(source__coords_valid__isnull=True)
|
||||
|
||||
# Date filter for geo_obj timestamp
|
||||
date_from = request.GET.get("date_from")
|
||||
@@ -1145,33 +1147,6 @@ class ObjItemListView(LoginRequiredMixin, View):
|
||||
lat = f"{latitude}N" if latitude > 0 else f"{abs(latitude)}S"
|
||||
geo_coords = f"{lat} {lon}"
|
||||
|
||||
if obj.geo_obj.coords_kupsat:
|
||||
longitude = obj.geo_obj.coords_kupsat.coords[0]
|
||||
latitude = obj.geo_obj.coords_kupsat.coords[1]
|
||||
lon = f"{longitude}E" if longitude > 0 else f"{abs(longitude)}W"
|
||||
lat = f"{latitude}N" if latitude > 0 else f"{abs(latitude)}S"
|
||||
kupsat_coords = f"{lat} {lon}"
|
||||
elif obj.geo_obj.coords_kupsat is not None:
|
||||
kupsat_coords = "-"
|
||||
|
||||
if obj.geo_obj.coords_valid:
|
||||
longitude = obj.geo_obj.coords_valid.coords[0]
|
||||
latitude = obj.geo_obj.coords_valid.coords[1]
|
||||
lon = f"{longitude}E" if longitude > 0 else f"{abs(longitude)}W"
|
||||
lat = f"{latitude}N" if latitude > 0 else f"{abs(latitude)}S"
|
||||
valid_coords = f"{lat} {lon}"
|
||||
elif obj.geo_obj.coords_valid is not None:
|
||||
valid_coords = "-"
|
||||
|
||||
if obj.geo_obj.distance_coords_kup is not None:
|
||||
distance_geo_kup = f"{obj.geo_obj.distance_coords_kup:.3f}"
|
||||
|
||||
if obj.geo_obj.distance_coords_valid is not None:
|
||||
distance_geo_valid = f"{obj.geo_obj.distance_coords_valid:.3f}"
|
||||
|
||||
if obj.geo_obj.distance_kup_valid is not None:
|
||||
distance_kup_valid = f"{obj.geo_obj.distance_kup_valid:.3f}"
|
||||
|
||||
satellite_name = "-"
|
||||
frequency = "-"
|
||||
freq_range = "-"
|
||||
|
||||
Reference in New Issue
Block a user