import / fix --> unions list / paginate orgs list in rancher link
This commit is contained in:
@@ -10,19 +10,19 @@ class RancherOrganizationService:
|
||||
different services of ranchers linked to organization
|
||||
"""
|
||||
|
||||
def orgs_linked_rancher(self, org: Organization = None):
|
||||
def orgs_linked_rancher(self, org: Organization = None, org_type_key: str = None):
|
||||
"""
|
||||
list of organizations with their information of rancher, herd, ....
|
||||
"""
|
||||
if org.type.key != 'ADM':
|
||||
organizations = get_all_org_child(org)
|
||||
else:
|
||||
organizations = Organization.objects.filter(type__key='CO')
|
||||
organizations = Organization.objects.filter(type__key=org_type_key)
|
||||
|
||||
linked_qs = RancherOrganizationLink.objects.select_related(
|
||||
'rancher',
|
||||
'organization'
|
||||
).filter(organization__in=organizations, organization__type__key='CO')
|
||||
).filter(organization__in=organizations, organization__type__key=org_type_key)
|
||||
|
||||
organizations = organizations.annotate(
|
||||
rancher_count=Count(
|
||||
|
||||
Reference in New Issue
Block a user