Skip to content

Commit

Permalink
Advanced search on destination by value (#98)
Browse files Browse the repository at this point in the history
* Advanced search on destination by value

* fix indent
  • Loading branch information
ashwin1111 authored Feb 23, 2024
1 parent d8a11f0 commit c376ce7
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
4 changes: 3 additions & 1 deletion fyle_accounting_mappings/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
EmployeeAttributesMappingView,
ExpenseFieldView,
DestinationAttributesView,
FyleFieldsView
FyleFieldsView,
PaginatedDestinationAttributesView
)

urlpatterns = [
Expand All @@ -44,4 +45,5 @@
path('expense_fields/', ExpenseFieldView.as_view()),
path('destination_attributes/', DestinationAttributesView.as_view()),
path('fyle_fields/', FyleFieldsView.as_view()),
path('paginated_destination_attributes/', PaginatedDestinationAttributesView.as_view()),
]
10 changes: 10 additions & 0 deletions fyle_accounting_mappings/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -464,3 +464,13 @@ class FyleFieldsView(ListAPIView):

def get_queryset(self):
return FyleFieldsSerializer().format_fyle_fields(self.kwargs["workspace_id"])

class PaginatedDestinationAttributesView(LookupFieldMixin, ListAPIView):
"""
Paginated Destination Attributes view
"""
queryset = DestinationAttribute.objects.filter(active=True)
serializer_class = DestinationAttributeSerializer
filter_backends = (DjangoFilterBackend,)
filterset_fields = {'attribute_type': {'exact', 'in'}, 'display_name': {'exact', 'in'}, 'value': {'icontains'}}
ordering_fields = ('value',)
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.29.2',
version='1.30.0',
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 c376ce7

Please sign in to comment.