You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
771 B
25 lines
771 B
from rest_framework import serializers
|
|
|
|
from apps.account.models import LocationHistory
|
|
|
|
|
|
class LocationHistorySerializer(serializers.ModelSerializer):
|
|
user = serializers.HiddenField(default=serializers.CurrentUserDefault())
|
|
class Meta:
|
|
model = LocationHistory
|
|
exclude = ('at_time',)
|
|
|
|
class ReverseGeolocationSerializer(serializers.Serializer):
|
|
"""Serializer for reverse geolocation request query parameters"""
|
|
lat = serializers.FloatField(
|
|
required=True,
|
|
min_value=-90.0,
|
|
max_value=90.0,
|
|
help_text="Latitude coordinate (-90 to 90)"
|
|
)
|
|
lon = serializers.FloatField(
|
|
required=True,
|
|
min_value=-180.0,
|
|
max_value=180.0,
|
|
help_text="Longitude coordinate (-180 to 180)"
|
|
)
|