feat: 增加enstat筛选条件
This commit is contained in:
parent
8808a14ef2
commit
448285e3a1
|
@ -38,6 +38,7 @@ class EnStatFilter(filters.FilterSet):
|
||||||
model = EnStat
|
model = EnStat
|
||||||
fields = {
|
fields = {
|
||||||
"mgroup": ["exact"],
|
"mgroup": ["exact"],
|
||||||
|
"mgroup__name": ["exact"],
|
||||||
"mgroup__belong_dept": ["exact"],
|
"mgroup__belong_dept": ["exact"],
|
||||||
"type": ["exact"],
|
"type": ["exact"],
|
||||||
"sflog": ["exact"],
|
"sflog": ["exact"],
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
from apps.utils.serializers import CustomModelSerializer
|
from apps.utils.serializers import CustomModelSerializer
|
||||||
from apps.enm.models import Mpoint, MpLog, MpointStat, EnStat
|
from apps.enm.models import Mpoint, MpLog, MpointStat, EnStat, EnStat2
|
||||||
from apps.utils.constants import EXCLUDE_FIELDS
|
from apps.utils.constants import EXCLUDE_FIELDS
|
||||||
from rest_framework import serializers
|
from rest_framework import serializers
|
||||||
from apps.mtm.models import Mgroup
|
from apps.mtm.models import Mgroup
|
||||||
|
@ -92,4 +92,9 @@ class EnStatSerializer(CustomModelSerializer):
|
||||||
belong_dept_name = serializers.CharField(source='mgroup.belong_dept.name', read_only=True)
|
belong_dept_name = serializers.CharField(source='mgroup.belong_dept.name', read_only=True)
|
||||||
class Meta:
|
class Meta:
|
||||||
model = EnStat
|
model = EnStat
|
||||||
|
fields = '__all__'
|
||||||
|
|
||||||
|
class EnStat2Serializer(CustomModelSerializer):
|
||||||
|
class Meta:
|
||||||
|
model = EnStat2
|
||||||
fields = '__all__'
|
fields = '__all__'
|
Loading…
Reference in New Issue