From d994fcb16ab1a55a8e6c1450f9c1cc068a3e17ff Mon Sep 17 00:00:00 2001 From: behruz-dev Date: Mon, 29 Sep 2025 17:52:26 +0500 Subject: [PATCH] change: change filter name --- core/apps/wherehouse/filters/invalid_product.py | 6 +++--- core/apps/wherehouse/views/inventory.py | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/core/apps/wherehouse/filters/invalid_product.py b/core/apps/wherehouse/filters/invalid_product.py index 9334bcc..18f6824 100644 --- a/core/apps/wherehouse/filters/invalid_product.py +++ b/core/apps/wherehouse/filters/invalid_product.py @@ -4,12 +4,12 @@ from core.apps.wherehouse.models import InvalidProduct class InvalidProductFilter(django_filters.FilterSet): - start_date = django_filters.DateFilter(field_name='expiry_date', lookup_expr='gte') - end_date = django_filters.DateFilter(field_name='expiry_date', lookup_expr='lte') + expiry_date_start = django_filters.DateFilter(field_name='expiry_date', lookup_expr='gte') + expiry_date_end = django_filters.DateFilter(field_name='expiry_date', lookup_expr='lte') class Meta: model = InvalidProduct fields = [ 'wherehouse', 'project_folder', 'status', 'invalid_status', - 'witnesses', 'expiry_date', 'start_date', 'end_date', + 'witnesses', 'expiry_date', 'expiry_date_start', 'expiry_date_end', ] \ No newline at end of file diff --git a/core/apps/wherehouse/views/inventory.py b/core/apps/wherehouse/views/inventory.py index 3a277f5..4e59a17 100644 --- a/core/apps/wherehouse/views/inventory.py +++ b/core/apps/wherehouse/views/inventory.py @@ -24,6 +24,8 @@ class InventoryListApiView(generics.GenericAPIView): project_folder_ids = request.query_params.getlist('project_folder_id') project_ids = request.query_params.getlist('project_ids') product_exists = request.query_params.get('product_exist') + start_date = request.query_params.get('start_date') + start_date = request.query_params.get('end_date') inventories = self.filter_queryset(self.queryset) if wherehouse_ids: