2.1.15 change cargo_type and transport_type names
This commit is contained in:
@@ -82,7 +82,7 @@ def get_profile_new_route_page_html(request, data):
|
|||||||
|
|
||||||
if data['owner_type'] == 'mover':
|
if data['owner_type'] == 'mover':
|
||||||
tpl = 'v2/blocks/b_make_mover_order.html'
|
tpl = 'v2/blocks/b_make_mover_order.html'
|
||||||
form.fields['type_transport'].choices = type_transport_choices[1:]
|
form.fields['type_transport'].choices = type_transport_choices[:-1]
|
||||||
else:
|
else:
|
||||||
tpl = 'v2/blocks/b_make_poster_order.html'
|
tpl = 'v2/blocks/b_make_poster_order.html'
|
||||||
form.fields['type_transport'].choices = type_transport_choices
|
form.fields['type_transport'].choices = type_transport_choices
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import copy
|
||||||
import json
|
import json
|
||||||
from copy import deepcopy
|
from copy import deepcopy
|
||||||
|
|
||||||
@@ -357,9 +358,9 @@ def get_cargo_type_by_transport_type_ajax(request):
|
|||||||
if not data or not 'type_transport' in data:
|
if not data or not 'type_transport' in data:
|
||||||
return JsonResponse({'html': 'недостаточно данных'}, status=400)
|
return JsonResponse({'html': 'недостаточно данных'}, status=400)
|
||||||
|
|
||||||
cargo_types = cargo_type_choices
|
cargo_types = copy.deepcopy(cargo_type_choices)
|
||||||
if data['type_transport'] in ['avia']:
|
if data['type_transport'] in ['avia']:
|
||||||
cargo_types = cargo_types[1:]
|
cargo_types = cargo_types[:2] + cargo_types[3:]
|
||||||
|
|
||||||
return JsonResponse({'cargo_types': cargo_types})
|
return JsonResponse({'cargo_types': cargo_types})
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,23 @@
|
|||||||
|
# Generated by Django 4.2.2 on 2025-01-14 18:27
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('RoutesApp', '0011_alter_route_from_address_point_and_more'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='route',
|
||||||
|
name='cargo_type',
|
||||||
|
field=models.CharField(choices=[('package', 'Посылка (до 30кг)'), ('letter', 'Письмо\\Документы'), ('passenger', 'Попутчик'), ('parcel', 'Бандероль (до 5кг)'), ('cargo', 'Груз (свыше 30 кг)')], default='parcel', verbose_name='Могу перевезти'),
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='route',
|
||||||
|
name='type_transport',
|
||||||
|
field=models.CharField(blank=True, choices=[('road', 'Авто (любой наземный транспорт)'), ('avia', 'Авиа'), ('', 'Мне без разницы')], default='', verbose_name='Выберите способ перевозки'),
|
||||||
|
),
|
||||||
|
]
|
||||||
18
RoutesApp/migrations/0013_alter_route_cargo_type.py
Normal file
18
RoutesApp/migrations/0013_alter_route_cargo_type.py
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
# Generated by Django 4.2.2 on 2025-01-14 18:30
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('RoutesApp', '0012_alter_route_cargo_type_alter_route_type_transport'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='route',
|
||||||
|
name='cargo_type',
|
||||||
|
field=models.CharField(choices=[('letter', 'Письмо\\Документы'), ('package', 'Посылка (до 30кг)'), ('passenger', 'Попутчик'), ('parcel', 'Бандероль (до 5кг)'), ('cargo', 'Груз (свыше 30 кг)')], default='parcel', verbose_name='Могу перевезти'),
|
||||||
|
),
|
||||||
|
]
|
||||||
@@ -5,9 +5,9 @@ from colorfield.fields import ColorField
|
|||||||
|
|
||||||
|
|
||||||
type_transport_choices = [
|
type_transport_choices = [
|
||||||
|
('road', _('Авто (любой наземный транспорт)')),
|
||||||
|
('avia', _('Авиа')),
|
||||||
('', _('Мне без разницы')),
|
('', _('Мне без разницы')),
|
||||||
('avia', _('Авиатранспорт')),
|
|
||||||
('road', _('Наземный транспорт'))
|
|
||||||
]
|
]
|
||||||
|
|
||||||
transfer_location_choices = (
|
transfer_location_choices = (
|
||||||
@@ -17,11 +17,11 @@ transfer_location_choices = (
|
|||||||
)
|
)
|
||||||
|
|
||||||
cargo_type_choices = (
|
cargo_type_choices = (
|
||||||
('passenger', _('Пассажир')),
|
('letter', _('Письмо\Документы')),
|
||||||
('cargo', _('Груз (свыше 30 кг)')),
|
|
||||||
('parcel', _('Бандероль (до 5кг)')),
|
|
||||||
('package', _('Посылка (до 30кг)')),
|
('package', _('Посылка (до 30кг)')),
|
||||||
('letter', _('Письмо\Документы'))
|
('passenger', _('Попутчик')),
|
||||||
|
('parcel', _('Бандероль (до 5кг)')),
|
||||||
|
('cargo', _('Груз (свыше 30 кг)')),
|
||||||
)
|
)
|
||||||
|
|
||||||
owner_type_choices = (
|
owner_type_choices = (
|
||||||
|
|||||||
Reference in New Issue
Block a user