diff --git a/qrtr_account/views.py b/qrtr_account/views.py index 89271a9..6b44812 100644 --- a/qrtr_account/views.py +++ b/qrtr_account/views.py @@ -54,6 +54,14 @@ class SliceViewSet(viewsets.ModelViewSet): queryset = Slice.objects.all() serializer_class = SliceSerializer + filterset_fields = { + 'id': ['exact', 'lte', 'gte'], + 'name': ['exact',], + 'balance': ['exact', 'lte', 'gte'], + 'bank_acc': ['exact'], + # 'slice_of': ['exact'] + } + class InstitutionViewSet(viewsets.ReadOnlyModelViewSet): """API endpoint that allows BankAccounts to be viewed. @@ -71,12 +79,14 @@ class TransactionViewSet(viewsets.ModelViewSet): 'bank__official_name'] filterset_fields = { - 'slice__id': ['exact', 'isnull'], + 'slice__id': ['exact',], 'slice__name': ['exact', ], 'authorized_date': ['exact', 'lte', 'gte', 'isnull'], 'updated_at': ['exact', 'lte', 'gte', 'isnull'], 'created_at': ['exact', 'lte', 'gte', 'isnull'], - 'trans_id': ['exact', 'lte', 'gte', 'isnull'], + 'trans_id': ['exact', 'lte', 'gte'], + 'id': ['exact', 'lte', 'gte'], + 'bank': ['exact'] } @action(detail=True, methods=['post'], url_path='split') @@ -101,6 +111,14 @@ class SliceTransactionViewSet(viewsets.ModelViewSet): serializer_class = SliceTransactionSerializer queryset = Slice.objects.all() + filterset_fields = { + 'id': ['exact', 'lte', 'gte'], + 'name': ['exact',], + 'balance': ['exact', 'lte', 'gte'], + 'bank_acc': ['exact'], + # 'slice_of': ['exact'] + } + # def get_queryset(self): # return Transaction.objects.filter(slice__pk=self.kwargs.get('slice_pk'))