feat: equip增加工段等筛选条件
This commit is contained in:
parent
c91533a328
commit
1134fc3809
|
@ -2,15 +2,20 @@ from django_filters import rest_framework as filters
|
|||
from apps.em.models import Equipment
|
||||
from datetime import datetime, timedelta
|
||||
|
||||
|
||||
class EquipFilterSet(filters.FilterSet):
|
||||
tag = filters.CharFilter(method='filter_tag')
|
||||
|
||||
class Meta:
|
||||
model = Equipment
|
||||
fields = {
|
||||
"keeper": ["exact"],
|
||||
"type": ["exact"],
|
||||
"power_kw": ["gte"],
|
||||
"belong_dept": ["exact"]
|
||||
"belong_dept": ["exact"],
|
||||
"belong_dept__name": ["exact"],
|
||||
"mgroup": ["exact"],
|
||||
"mgroup__name": ["exact"]
|
||||
}
|
||||
|
||||
def filter_tag(self, queryset, name, value):
|
||||
|
|
Loading…
Reference in New Issue