rcertificate返回remployee_name等

This commit is contained in:
曹前明 2022-06-27 18:03:10 +08:00
parent b01db62406
commit c72548b6f9
3 changed files with 6 additions and 0 deletions

View File

@ -1,3 +1,4 @@
from numpy import True_
from apps.hrm.models import Certificate, Employee
from apps.hrm.serializers import phone_check
from apps.rpm.models import Rcertificate, Remployee, Rfile, Rparty, Rpjcertificate, Rpjfile, Rpjmember, Rpj
@ -108,6 +109,9 @@ class RcertificateCreateUpdateSerializer(CustomModelSerializer):
class RcertificateSerializer(CustomModelSerializer):
remployee_name = serializers.CharField(source='remployee.name', read_only=True)
rparty_name = serializers.CharField(source='rparty.name', read_only=True)
class Meta:
model = Rcertificate
fields = '__all__'

View File

@ -96,6 +96,7 @@ class RcertificateViewSet(CustomModelViewSet):
create_serializer_class = RcertificateCreateUpdateSerializer
update_serializer_class = RcertificateCreateUpdateSerializer
serializer_class = RcertificateSerializer
filterset_fields = ['remployee', 'remployee__rparty']
def get_queryset(self):
queryset = super().get_queryset()

View File

@ -19,3 +19,4 @@ channels==3.0.4
channels-redis==3.4.0
django-restql==0.15.2
stomp.py==8.0.0
shapely==1.8.2