Skip to content

Commit

Permalink
update filters
Browse files Browse the repository at this point in the history
  • Loading branch information
claire-peters committed Sep 13, 2024
1 parent a83aefd commit 5f819ea
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions coldfront/plugins/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@ class AllocationRequestFilter(filters.FilterSet):
created = filters.DateFromToRangeFilter(label='Created Range')
fulfilled = filters.BooleanFilter(label='Fulfilled', method='filter_fulfilled')
fulfilled_date = filters.DateFromToRangeFilter(label='Fulfilled Date Range')
requested_size = filters.NumericRangeFilter(label='Requested Size', field_name='requested_size')
pi = filters.CharFilter(label='PI', field_name='project__pi__full_name', lookup_expr='icontains')
project = filters.CharFilter(label='Project', field_name='project__title', lookup_expr='icontains')
time_to_fulfillment = filters.NumericRangeFilter(label='Time-to-fulfillment Range', method='filter_time_to_fulfillment')

class Meta:
Expand All @@ -129,6 +132,8 @@ class Meta:
'created',
'fulfilled',
'fulfilled_date',
'pi',
'requested_size',
'time_to_fulfillment',
]

Expand Down Expand Up @@ -262,6 +267,8 @@ class AllocationChangeRequestFilter(filters.FilterSet):
created = filters.DateFromToRangeFilter()
fulfilled = filters.BooleanFilter(label='Fulfilled', method='filter_fulfilled')
fulfilled_date = filters.DateFromToRangeFilter(label='Fulfilled Date Range')
pi = filters.CharFilter(label='PI', field_name='allocation__project__pi__full_name', lookup_expr='icontains')
project = filters.CharFilter(label='Project', field_name='allocation__project__title', lookup_expr='icontains')
time_to_fulfillment = filters.NumericRangeFilter(label='Time-to-fulfillment Range', method='filter_time_to_fulfillment')

class Meta:
Expand All @@ -270,6 +277,8 @@ class Meta:
'created',
'fulfilled',
'fulfilled_date',
'pi',
'project',
'time_to_fulfillment',
]

Expand Down

0 comments on commit 5f819ea

Please sign in to comment.