mirror of
https://github.com/task-17-lct/backend.git
synced 2024-11-23 22:13:43 +03:00
resolve confs
This commit is contained in:
parent
9e02502cb3
commit
ae46e79969
|
@ -80,7 +80,7 @@ def post(self, request):
|
||||||
if city_id:
|
if city_id:
|
||||||
region = get_object_or_404(City, oid=city_id)
|
region = get_object_or_404(City, oid=city_id)
|
||||||
else:
|
else:
|
||||||
region = choice(City.objects.annotate(points_count=Count('points')).filter(title__in=city_in_hotels).filter(points_count__gt=300))
|
region = choice(City.objects.annotate(points_count=Count('points')).filter(title__in=city_in_hotels).filter(points_count__gt=400))
|
||||||
if not start_date and end_date:
|
if not start_date and end_date:
|
||||||
tour_length = choice([timedelta(days=i) for i in range(1, 4)])
|
tour_length = choice([timedelta(days=i) for i in range(1, 4)])
|
||||||
start_date = end_date - tour_length
|
start_date = end_date - tour_length
|
||||||
|
|
|
@ -27,7 +27,6 @@ class HotelOnboardingRetrieve(serializers.Serializer):
|
||||||
|
|
||||||
|
|
||||||
class TinderGetEventFilterSerializer(serializers.Serializer):
|
class TinderGetEventFilterSerializer(serializers.Serializer):
|
||||||
<<<<<<< HEAD
|
|
||||||
type = serializers.ListField(child=serializers.ChoiceField(['attraction', 'museum', 'movie', 'play', 'concert']))
|
type = serializers.ListField(child=serializers.ChoiceField(['attraction', 'museum', 'movie', 'play', 'concert']))
|
||||||
event = EventSerializer()
|
event = EventSerializer()
|
||||||
|
|
||||||
|
@ -44,8 +43,6 @@ class DailySelectionSerializerInput(serializers.Serializer):
|
||||||
|
|
||||||
class DailySelectionSerializer(serializers.Serializer):
|
class DailySelectionSerializer(serializers.Serializer):
|
||||||
nodes = serializers.ListField(child=DailySelectionNodeSerializer(), write_only=True)
|
nodes = serializers.ListField(child=DailySelectionNodeSerializer(), write_only=True)
|
||||||
=======
|
|
||||||
>>>>>>> 60a019fcf7e95a63e66b6b0fcbf1495da8a3e8b7
|
|
||||||
type = serializers.ListField(
|
type = serializers.ListField(
|
||||||
child=serializers.ChoiceField(
|
child=serializers.ChoiceField(
|
||||||
["attraction", "museum", "movie", "play", "concert"]
|
["attraction", "museum", "movie", "play", "concert"]
|
||||||
|
|
|
@ -429,13 +429,13 @@ def generate_route(point1: BasePoint, point2: BasePoint, velocity: float):
|
||||||
time = time_func(distance, velocity)
|
time = time_func(distance, velocity)
|
||||||
|
|
||||||
|
|
||||||
def time_func(km_distance: float):
|
def time_func(km_distance: float, velocity):
|
||||||
return timedelta(minutes=(km_distance) / (4.0 / 60))
|
return timedelta(minutes=(km_distance) / (velocity / 60))
|
||||||
|
|
||||||
|
|
||||||
def generate_route(point1: BasePoint, point2: BasePoint):
|
def generate_route(point1: BasePoint, point2: BasePoint, velocity):
|
||||||
distance = dist_func(point1, point2)
|
distance = dist_func(point1, point2)
|
||||||
time = time_func(distance)
|
time = time_func(distance, velocity)
|
||||||
return {
|
return {
|
||||||
"type": "transition",
|
"type": "transition",
|
||||||
"distance": distance,
|
"distance": distance,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user