mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-09-05 17:30:30 +00:00
[Update] 优化sql, or方式改为union (#3682)
* [Update] 优化sql, or方式改为union * [Update] 优化union操作,直接union后,queryset 的一些参数不能使用,如annoate, 如filter assets__isnull=True
This commit is contained in:
@@ -93,7 +93,7 @@ class AssetPermission(BasePermission):
|
||||
models.Prefetch('nodes', queryset=Node.objects.all().only('key')),
|
||||
models.Prefetch('assets', queryset=Asset.objects.all().only('id')),
|
||||
models.Prefetch('system_users', queryset=SystemUser.objects.all().only('id'))
|
||||
)
|
||||
).order_by()
|
||||
|
||||
def get_all_assets(self):
|
||||
from assets.models import Node
|
||||
|
Reference in New Issue
Block a user