feat: 设备增加power_kw查询

This commit is contained in:
caoqianming 2023-07-05 13:44:41 +08:00
parent 93881852d0
commit 235d17f193
1 changed files with 5 additions and 1 deletions

View File

@ -6,7 +6,11 @@ class EquipFilterSet(filters.FilterSet):
tag = filters.CharFilter(method='filter_tag')
class Meta:
model = Equipment
fields = ['keeper', 'type', 'tag']
fields = {
"keeper": ["exact"],
"type": ["exact"],
"power_kw": ["gte"],
}
def filter_tag(self, queryset, name, value):
now = datetime.now()