Skip to content

Commit

Permalink
Advance mapping search with proper ordering (#100)
Browse files Browse the repository at this point in the history
* Advance Search For mappings Page

* lint resolved

* minor change

* comment resolved

* lint resolved

* bump up version

* ordering by value

* bump up patch version
  • Loading branch information
Ashutosh619-sudo authored Mar 5, 2024
1 parent ff514ae commit 3601418
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions fyle_accounting_mappings/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,11 +286,11 @@ def get_queryset(self):
elif mapped is False:
param = ~Q(mapping__destination_type=destination_type)
else:
return ExpenseAttribute.objects.filter(Q(**filters))
return ExpenseAttribute.objects.filter(Q(**filters)).order_by('value')
final_filter = Q(**filters)
if param:
final_filter = final_filter & param
return ExpenseAttribute.objects.filter(final_filter)
return ExpenseAttribute.objects.filter(final_filter).order_by('value')


class CategoryAttributesMappingView(ListAPIView):
Expand Down Expand Up @@ -337,11 +337,11 @@ def get_queryset(self):
elif mapped is False:
param = ~Q(categorymapping__source_category_id__in=source_categories)
else:
return ExpenseAttribute.objects.filter(Q(**filters))
return ExpenseAttribute.objects.filter(Q(**filters)).order_by('value')
final_filter = Q(**filters)
if param:
final_filter = final_filter & param
return ExpenseAttribute.objects.filter(final_filter)
return ExpenseAttribute.objects.filter(final_filter).order_by('value')

class EmployeeAttributesMappingView(ListAPIView):

Expand Down Expand Up @@ -383,11 +383,11 @@ def get_queryset(self):
elif mapped is False:
param = ~Q(employeemapping__source_employee_id__in=source_employees)
else:
return ExpenseAttribute.objects.filter(Q(**filters))
return ExpenseAttribute.objects.filter(Q(**filters)).order_by('value')
final_filter = Q(**filters)
if param:
final_filter = final_filter & param
return ExpenseAttribute.objects.filter(final_filter)
return ExpenseAttribute.objects.filter(final_filter).order_by('value')


class ExpenseFieldView(ListAPIView):
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

setuptools.setup(
name='fyle-accounting-mappings',
version='1.31.0',
version='1.31.1',
author='Shwetabh Kumar',
author_email='[email protected]',
description='Django application to store the fyle accounting mappings in a generic manner',
Expand Down

0 comments on commit 3601418

Please sign in to comment.