mirror of https://github.com/jumpserver/jumpserver
feat(orgs): relation 增加搜索功能
parent
44d9aff573
commit
0390e37fd5
|
@ -2,6 +2,7 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
from django.utils.translation import ugettext as _
|
from django.utils.translation import ugettext as _
|
||||||
|
from django.db.models import Q
|
||||||
from rest_framework import status
|
from rest_framework import status
|
||||||
from rest_framework.views import Response
|
from rest_framework.views import Response
|
||||||
from rest_framework_bulk import BulkModelViewSet
|
from rest_framework_bulk import BulkModelViewSet
|
||||||
|
@ -72,6 +73,7 @@ class OrgMemberRelationBulkViewSet(JMSBulkRelationModelViewSet):
|
||||||
m2m_field = Organization.members.field
|
m2m_field = Organization.members.field
|
||||||
serializer_class = OrgMemberSerializer
|
serializer_class = OrgMemberSerializer
|
||||||
filterset_class = OrgMemberRelationFilterSet
|
filterset_class = OrgMemberRelationFilterSet
|
||||||
|
search_fields = ('user__name', 'user__username', 'org__name')
|
||||||
|
|
||||||
def perform_bulk_create(self, serializer):
|
def perform_bulk_create(self, serializer):
|
||||||
data = serializer.validated_data
|
data = serializer.validated_data
|
||||||
|
|
Loading…
Reference in New Issue