diff --git a/stratoflights/settings.py b/stratoflights/settings.py index 79ade80..224cb3a 100644 --- a/stratoflights/settings.py +++ b/stratoflights/settings.py @@ -168,7 +168,7 @@ AUTH_USER_MODEL = 'stratoflights_api.User' REST_FRAMEWORK = { 'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.PageNumberPagination', - 'PAGE_SIZE': 100, + 'PAGE_SIZE': 1000, 'DEFAULT_SCHEMA_CLASS': 'drf_spectacular.openapi.AutoSchema', diff --git a/stratoflights_api/custom_pagination.py b/stratoflights_api/custom_pagination.py index 6d37de8..2e5070b 100644 --- a/stratoflights_api/custom_pagination.py +++ b/stratoflights_api/custom_pagination.py @@ -4,7 +4,7 @@ from rest_framework.response import Response class CustomLimitOffsetPagination(LimitOffsetPagination): limit_query_param = 'limit' offset_query_param = 'skip' - max_limit = 100 + max_limit = 1000 default_limit = 10 diff --git a/stratoflights_api/models.py b/stratoflights_api/models.py index 9e36d62..cdeeb12 100644 --- a/stratoflights_api/models.py +++ b/stratoflights_api/models.py @@ -50,6 +50,10 @@ class TelemetryPacket(models.Model): payload = models.JSONField(blank=True, default=dict) raw_data = models.JSONField(blank=True, default=dict) created_at = models.DateTimeField(auto_now_add=True) + def __str__(self): + return f"packet {self.satellite} {self.lat} {self.lon} {self.alt} {self.timestamp}" + class Meta: + ordering = ["-timestamp"] class PreditctionTemplate(models.Model): diff --git a/stratoflights_api/services/tawhiri.py b/stratoflights_api/services/tawhiri.py index 6908083..5a6bf04 100644 --- a/stratoflights_api/services/tawhiri.py +++ b/stratoflights_api/services/tawhiri.py @@ -6,7 +6,7 @@ from zoneinfo import ZoneInfo from collections import OrderedDict class TawhiriClient: - BASE_URL = "https://api.v2.sondehub.org/tawhiri" + BASE_URL = "http://127.0.0.1:8080/api/v1/prediction" TIMEOUT = 15 @staticmethod