diff --git a/GeneralApp/views.py b/GeneralApp/views.py index 4b70fd7..e09199d 100644 --- a/GeneralApp/views.py +++ b/GeneralApp/views.py @@ -35,19 +35,34 @@ def test_code(request): routes = [ Route( - type_transport='avia', + type_transport='road', departure_DT=datetime(year=2024, month=9, day=1), arrival_DT=datetime(year=2024, month=9, day=3), - from_address_point = from_air.id, - to_address_point = to_air.id, - from_city = from_air.city, - to_city = to_air.city, - weight = item, - phone = '1234567890', - owner = request.user + from_address_point=to_air.city.id, + to_address_point=from_air.city.id, + from_city=to_air.city, + to_city=from_air.city, + weight=item, + phone='0987654321', + owner=request.user ) for item in range(1000) ] + # routes = [ + # Route( + # type_transport='avia', + # departure_DT=datetime(year=2024, month=9, day=1), + # arrival_DT=datetime(year=2024, month=9, day=3), + # from_address_point = from_air.id, + # to_address_point = to_air.id, + # from_city = from_air.city, + # to_city = to_air.city, + # weight = item, + # phone = '1234567890', + # owner = request.user + # ) for item in range(1000) + # ] + Route.objects.bulk_create(routes)