Skip to content

data_views

main.views.data_views ¤

Views for getting data from the framework database.

Classes¤

FrameworkView ¤

Bases: View

A view that returns the core framework as a JSON string.

Methods:¤
get(request) ¤

Define the GET response.

Parameters:

Name Type Description Default
request HttpRequest

A GET request with no required parameters.

required

Returns:

Type Description
JsonResponse

A string of the full framework in JSON format. The top-level components are: - competency_domains: A list of the Competency Domains - competencies: A list of the Competencies - skills: A list of the Skills - skill_levels: A list of the Skill Levels

Source code in main/views/data_views.py
12
13
14
15
16
17
18
19
20
21
22
23
24
25
def get(self, request: HttpRequest) -> JsonResponse:
    """Define the GET response.

    Args:
        request: A GET request with no required parameters.

    Returns:
        A string of the full framework in JSON format. The top-level components are:
            - competency_domains: A list of the Competency Domains
            - competencies: A list of the Competencies
            - skills: A list of the Skills
            - skill_levels: A list of the Skill Levels
    """
    return JsonResponse(export_framework(), json_dumps_params=dict(indent=2))

Functions:¤