rcertificate返回remployee_name等
This commit is contained in:
parent
b01db62406
commit
c72548b6f9
|
@ -1,3 +1,4 @@
|
||||||
|
from numpy import True_
|
||||||
from apps.hrm.models import Certificate, Employee
|
from apps.hrm.models import Certificate, Employee
|
||||||
from apps.hrm.serializers import phone_check
|
from apps.hrm.serializers import phone_check
|
||||||
from apps.rpm.models import Rcertificate, Remployee, Rfile, Rparty, Rpjcertificate, Rpjfile, Rpjmember, Rpj
|
from apps.rpm.models import Rcertificate, Remployee, Rfile, Rparty, Rpjcertificate, Rpjfile, Rpjmember, Rpj
|
||||||
|
@ -108,6 +109,9 @@ class RcertificateCreateUpdateSerializer(CustomModelSerializer):
|
||||||
|
|
||||||
|
|
||||||
class RcertificateSerializer(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:
|
class Meta:
|
||||||
model = Rcertificate
|
model = Rcertificate
|
||||||
fields = '__all__'
|
fields = '__all__'
|
||||||
|
|
|
@ -96,6 +96,7 @@ class RcertificateViewSet(CustomModelViewSet):
|
||||||
create_serializer_class = RcertificateCreateUpdateSerializer
|
create_serializer_class = RcertificateCreateUpdateSerializer
|
||||||
update_serializer_class = RcertificateCreateUpdateSerializer
|
update_serializer_class = RcertificateCreateUpdateSerializer
|
||||||
serializer_class = RcertificateSerializer
|
serializer_class = RcertificateSerializer
|
||||||
|
filterset_fields = ['remployee', 'remployee__rparty']
|
||||||
|
|
||||||
def get_queryset(self):
|
def get_queryset(self):
|
||||||
queryset = super().get_queryset()
|
queryset = super().get_queryset()
|
||||||
|
|
|
@ -19,3 +19,4 @@ channels==3.0.4
|
||||||
channels-redis==3.4.0
|
channels-redis==3.4.0
|
||||||
django-restql==0.15.2
|
django-restql==0.15.2
|
||||||
stomp.py==8.0.0
|
stomp.py==8.0.0
|
||||||
|
shapely==1.8.2
|
||||||
|
|
Loading…
Reference in New Issue