1.7.12 fix search_matches sendmail link
This commit is contained in:
@@ -3,6 +3,7 @@ import json
|
||||
from django.http import HttpResponse, Http404, FileResponse
|
||||
from django.template import loader, RequestContext
|
||||
from django.contrib.auth.decorators import login_required
|
||||
|
||||
from .models import *
|
||||
from django.conf import settings
|
||||
from .funcs import get_inter_http_response
|
||||
@@ -24,29 +25,33 @@ def test_code(request):
|
||||
):
|
||||
raise Http404
|
||||
|
||||
from RoutesApp.funcs import get_city_by_type_transport_and_address_point
|
||||
from RoutesApp.search_matches import search_matches
|
||||
from RoutesApp.models import Route
|
||||
from ReferenceDataApp.models import Airport, City
|
||||
search_matches(Route.objects.filter(from_city__id=57062))
|
||||
|
||||
res = None
|
||||
|
||||
from_air = Airport.objects.get(iata_code='MSQ')
|
||||
to_air = Airport.objects.get(iata_code='SVO')
|
||||
|
||||
routes = [
|
||||
Route(
|
||||
type_transport='road',
|
||||
departure_DT=datetime.now() + timedelta(days=7),
|
||||
arrival_DT=datetime.now() + timedelta(days=8),
|
||||
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(100)
|
||||
]
|
||||
# from RoutesApp.funcs import get_city_by_type_transport_and_address_point
|
||||
# from RoutesApp.models import Route
|
||||
# from ReferenceDataApp.models import Airport, City
|
||||
#
|
||||
# res = None
|
||||
#
|
||||
# from_air = Airport.objects.get(iata_code='MSQ')
|
||||
# to_air = Airport.objects.get(iata_code='SVO')
|
||||
#
|
||||
# routes = [
|
||||
# Route(
|
||||
# type_transport='road',
|
||||
# departure_DT=datetime.now() + timedelta(days=7),
|
||||
# arrival_DT=datetime.now() + timedelta(days=8),
|
||||
# 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(100)
|
||||
# ]
|
||||
|
||||
# routes = [
|
||||
# Route(
|
||||
@@ -62,8 +67,8 @@ def test_code(request):
|
||||
# owner = request.user
|
||||
# ) for item in range(1000)
|
||||
# ]
|
||||
|
||||
Route.objects.bulk_create(routes)
|
||||
#
|
||||
# Route.objects.bulk_create(routes)
|
||||
|
||||
|
||||
# from RoutesApp.search_matches import search_matches
|
||||
|
||||
Reference in New Issue
Block a user