perf: 批量命令新增过滤选项 (#8749)

Co-authored-by: feng626 <1304903146@qq.com>
pull/8750/head
fit2bot 2 years ago committed by GitHub
parent 78133b0c60
commit 2f8a07e665
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -126,9 +126,12 @@ class CommandExecutionViewSet(ListModelMixin, OrgGenericViewSet):
class CommandExecutionHostRelationViewSet(OrgRelationMixin, OrgBulkModelViewSet): class CommandExecutionHostRelationViewSet(OrgRelationMixin, OrgBulkModelViewSet):
serializer_class = CommandExecutionHostsRelationSerializer serializer_class = CommandExecutionHostsRelationSerializer
m2m_field = CommandExecution.hosts.field m2m_field = CommandExecution.hosts.field
filterset_fields = [ filterset_fields = {
'id', 'asset', 'commandexecution' 'id': ['exact'],
] 'asset': ['exact'],
'asset__hostname': ['icontains'],
'commandexecution': ['exact'],
}
search_fields = ('asset__hostname', ) search_fields = ('asset__hostname', )
http_method_names = ['options', 'get'] http_method_names = ['options', 'get']
rbac_perms = { rbac_perms = {

Loading…
Cancel
Save