[FIX] ATTENDANCE: Hour count filter month to drop down list
This commit is contained in:
@@ -98,7 +98,20 @@ class AttendanceOverTimeFilter(FilterSet):
|
||||
Args:
|
||||
FilterSet (class): custom filter set class to apply styling
|
||||
"""
|
||||
|
||||
MONTH_CHOICES = [
|
||||
('January', 'January'),
|
||||
('February', 'February'),
|
||||
('March', 'March'),
|
||||
('April', 'April'),
|
||||
('May', 'May'),
|
||||
('June', 'June'),
|
||||
('July', 'July'),
|
||||
('August', 'August'),
|
||||
('September', 'September'),
|
||||
('October', 'October'),
|
||||
('November', 'November'),
|
||||
('December', 'December'),
|
||||
]
|
||||
search = django_filters.CharFilter(method=filter_by_name)
|
||||
|
||||
hour_account__gte = DurationInSecondsFilter(
|
||||
@@ -113,7 +126,7 @@ class AttendanceOverTimeFilter(FilterSet):
|
||||
overtime__lte = DurationInSecondsFilter(
|
||||
field_name="overtime_second", lookup_expr="lte"
|
||||
)
|
||||
month = django_filters.CharFilter(field_name="month", lookup_expr="icontains")
|
||||
month = django_filters.ChoiceFilter(choices=MONTH_CHOICES,lookup_expr="icontains")
|
||||
|
||||
class Meta:
|
||||
"""
|
||||
|
||||
@@ -60,6 +60,8 @@
|
||||
<label class="oh-label">{% trans "Overtime" %}</label>
|
||||
{{f.form.overtime}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-12 col-md-12 col-lg-6">
|
||||
<div class="oh-input-group">
|
||||
<label class="oh-label">{% trans "Year" %}</label>
|
||||
{{f.form.year}}
|
||||
|
||||
Reference in New Issue
Block a user