change: change filter name

This commit is contained in:
behruz-dev
2025-09-29 17:52:26 +05:00
parent 5cf6aafdcc
commit d994fcb16a
2 changed files with 5 additions and 3 deletions

View File

@@ -4,12 +4,12 @@ from core.apps.wherehouse.models import InvalidProduct
class InvalidProductFilter(django_filters.FilterSet): class InvalidProductFilter(django_filters.FilterSet):
start_date = django_filters.DateFilter(field_name='expiry_date', lookup_expr='gte') expiry_date_start = django_filters.DateFilter(field_name='expiry_date', lookup_expr='gte')
end_date = django_filters.DateFilter(field_name='expiry_date', lookup_expr='lte') expiry_date_end = django_filters.DateFilter(field_name='expiry_date', lookup_expr='lte')
class Meta: class Meta:
model = InvalidProduct model = InvalidProduct
fields = [ fields = [
'wherehouse', 'project_folder', 'status', 'invalid_status', 'wherehouse', 'project_folder', 'status', 'invalid_status',
'witnesses', 'expiry_date', 'start_date', 'end_date', 'witnesses', 'expiry_date', 'expiry_date_start', 'expiry_date_end',
] ]

View File

@@ -24,6 +24,8 @@ class InventoryListApiView(generics.GenericAPIView):
project_folder_ids = request.query_params.getlist('project_folder_id') project_folder_ids = request.query_params.getlist('project_folder_id')
project_ids = request.query_params.getlist('project_ids') project_ids = request.query_params.getlist('project_ids')
product_exists = request.query_params.get('product_exist') 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) inventories = self.filter_queryset(self.queryset)
if wherehouse_ids: if wherehouse_ids: