dev #14
@@ -35,19 +35,34 @@ def test_code(request):
|
|||||||
|
|
||||||
routes = [
|
routes = [
|
||||||
Route(
|
Route(
|
||||||
type_transport='avia',
|
type_transport='road',
|
||||||
departure_DT=datetime(year=2024, month=9, day=1),
|
departure_DT=datetime(year=2024, month=9, day=1),
|
||||||
arrival_DT=datetime(year=2024, month=9, day=3),
|
arrival_DT=datetime(year=2024, month=9, day=3),
|
||||||
from_address_point = from_air.id,
|
from_address_point=to_air.city.id,
|
||||||
to_address_point = to_air.id,
|
to_address_point=from_air.city.id,
|
||||||
from_city = from_air.city,
|
from_city=to_air.city,
|
||||||
to_city = to_air.city,
|
to_city=from_air.city,
|
||||||
weight = item,
|
weight=item,
|
||||||
phone = '1234567890',
|
phone='0987654321',
|
||||||
owner = request.user
|
owner=request.user
|
||||||
) for item in range(1000)
|
) 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)
|
Route.objects.bulk_create(routes)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user