MCPcopy Index your code
hub / github.com/1Panel-dev/MaxKB / page

Method page

apps/application/serializers/application.py:482–507  ·  view source on GitHub ↗
(self, current_page: int, page_size: int, instance: Dict)

Source from the content-addressed store, hash-verified

480 )
481
482 def page(self, current_page: int, page_size: int, instance: Dict):
483 self.is_valid(raise_exception=True)
484 req_dict = ApplicationQueryRequest(data=instance)
485 req_dict.is_valid(raise_exception=True)
486 workspace_id = self.data.get("workspace_id")
487 user_id = self.data.get("user_id")
488 workspace_manage = is_workspace_manage_permission_read(user_id, workspace_id, "APPLICATION:READ")
489 is_x_pack_ee = self.is_x_pack_ee()
490 result = native_page_search(
491 current_page,
492 page_size,
493 self.get_query_set(req_dict.data, workspace_manage, is_x_pack_ee),
494 get_file_content(
495 os.path.join(
496 PROJECT_DIR,
497 "apps",
498 "application",
499 "sql",
500 "list_application.sql"
501 if workspace_manage
502 else ("list_application_user_ee.sql" if is_x_pack_ee else "list_application_user.sql"),
503 )
504 ),
505 )
506
507 return ResourceMappingSerializer().get_resource_count(result)
508
509
510class ApplicationImportRequest(serializers.Serializer):

Callers 5

getMethod · 0.45
getMethod · 0.45
getMethod · 0.45
getMethod · 0.45
getMethod · 0.45

Calls 11

is_validMethod · 0.95
is_x_pack_eeMethod · 0.95
get_query_setMethod · 0.95
native_page_searchFunction · 0.90
get_file_contentFunction · 0.90
get_resource_countMethod · 0.80
is_validMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected