perf: 优化 manager 和 acl 的 组织

This commit is contained in:
ibuler
2023-06-12 16:00:14 +08:00
parent 24272d3162
commit 5c2b54ad3b
5 changed files with 20 additions and 4 deletions

View File

@@ -392,7 +392,8 @@ class RelatedManager:
return self.filter_queryset_by_model(value, to_model)
def get_attr_q(self):
q = self._get_filter_attrs_q(self.value, apps.get_model(self.field.to))
to_model = apps.get_model(self.field.to)
q = self._get_filter_attrs_q(self.value, to_model)
return q
def all(self):