update
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -2590,7 +2590,10 @@ def all_products_transport_excel(request):
|
|||||||
filters['product'] = product_type
|
filters['product'] = product_type
|
||||||
|
|
||||||
if destination_province and destination_province != 'undefined':
|
if destination_province and destination_province != 'undefined':
|
||||||
filters['destination_province'] = normalize_persian_arabic_text(destination_province)
|
if destination_province == 'مرکزی':
|
||||||
|
filters['destination_province'] = 'مركزي'
|
||||||
|
else:
|
||||||
|
filters['destination_province'] = destination_province
|
||||||
|
|
||||||
if date1 and date2 and date1 != 'undefined' and date2 != 'undefined':
|
if date1 and date2 and date1 != 'undefined' and date2 != 'undefined':
|
||||||
try:
|
try:
|
||||||
|
|||||||
@@ -160,7 +160,7 @@ def normalize_persian_arabic_text(text):
|
|||||||
# 'ک' (U+06A9 - Persian Kaf) -> 'ك' (U+0643 - Arabic Kaf)
|
# 'ک' (U+06A9 - Persian Kaf) -> 'ك' (U+0643 - Arabic Kaf)
|
||||||
# 'ی' (U+06CC - Persian Yeh) -> 'ي' (U+064A - Arabic Yeh)
|
# 'ی' (U+06CC - Persian Yeh) -> 'ي' (U+064A - Arabic Yeh)
|
||||||
text = str(text)
|
text = str(text)
|
||||||
text = text.replace('ک', 'ك') # Persian Kaf to Arabic Kaf
|
# text = text.replace('ک', 'ك') # Persian Kaf to Arabic Kaf
|
||||||
text = text.replace('ی', 'ي') # Persian Yeh to Arabic Yeh
|
text = text.replace('ی', 'ي') # Persian Yeh to Arabic Yeh
|
||||||
|
|
||||||
return text
|
return text
|
||||||
|
|||||||
10
app/views.py
10
app/views.py
@@ -4522,7 +4522,10 @@ class AllProductsTransportViewSet(viewsets.ModelViewSet):
|
|||||||
filters['product'] = product_type
|
filters['product'] = product_type
|
||||||
|
|
||||||
if destination_province and destination_province != 'undefined':
|
if destination_province and destination_province != 'undefined':
|
||||||
filters['destination_province'] = normalize_persian_arabic_text(destination_province)
|
if destination_province == 'مرکزی':
|
||||||
|
filters['destination_province'] = 'مرکزي'
|
||||||
|
else:
|
||||||
|
filters['destination_province'] = destination_province
|
||||||
|
|
||||||
if date1 and date2 and date1 != 'undefined' and date2 != 'undefined':
|
if date1 and date2 and date1 != 'undefined' and date2 != 'undefined':
|
||||||
try:
|
try:
|
||||||
@@ -4762,7 +4765,10 @@ class AllProductsTransportDashboardView(APIView):
|
|||||||
destination_province = request.GET.get('destination_province')
|
destination_province = request.GET.get('destination_province')
|
||||||
kill_house_filterset_class = AllProductsTransportFilterSet
|
kill_house_filterset_class = AllProductsTransportFilterSet
|
||||||
if destination_province and destination_province != 'undefined':
|
if destination_province and destination_province != 'undefined':
|
||||||
filters['destination_province'] = normalize_persian_arabic_text(destination_province)
|
if destination_province == 'مرکزی':
|
||||||
|
filters['destination_province'] = 'مركزي'
|
||||||
|
else:
|
||||||
|
filters['destination_province'] = destination_province
|
||||||
queryset = AllProductsTransport.objects.filter(**filters)
|
queryset = AllProductsTransport.objects.filter(**filters)
|
||||||
|
|
||||||
if search and search != 'undefined' and search.strip():
|
if search and search != 'undefined' and search.strip():
|
||||||
|
|||||||
Reference in New Issue
Block a user