Skip to content

AppProject

AppProject

Bases: TemplateModel

A class that represents an app project.

Attributes:

Name Type Description
name

str: The name of the model. Name should be snake_case. From TemplateModel

auth_object AuthObject | None

AuthObject | None: Object that is used as authorization

app_objects list[AppObject]

list[AppObject]: The list of app objects in the project.

Source code in warp_fastapi\app_project.py
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
class AppProject(TemplateModel):
    """
    A class that represents an app project.

    Attributes:
        name: str: The name of the model. Name should be snake_case. From TemplateModel
        auth_object: AuthObject | None: Object that is used as authorization
        app_objects: list[AppObject]: The list of app objects in the project.
    """

    app_objects: list[AppObject]
    auth_object: AuthObject | None = None

    def __init__(self, name: str, *args: AppObject, auth_object: AuthObject | None = None):
        """
        Initialize the project with the given name and app objects.

        Args:
            name: The name of the project.
            args: AppObject: A list of app objects for the project.
            auth_object: AuthObject|None: Authorization object.
        """
        if auth_object:
            if auth_object not in args:
                args = args + (auth_object,)
        else:
            for app_obj in args:
                if app_obj.secure:
                    raise Exception("App Object can't be secure without Authenication Object")

        super().__init__(name=name, app_objects=args, auth_object=auth_object)

__init__(name, *args, auth_object=None)

Initialize the project with the given name and app objects.

Parameters:

Name Type Description Default
name str

The name of the project.

required
args AppObject

AppObject: A list of app objects for the project.

()
auth_object AuthObject | None

AuthObject|None: Authorization object.

None
Source code in warp_fastapi\app_project.py
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
def __init__(self, name: str, *args: AppObject, auth_object: AuthObject | None = None):
    """
    Initialize the project with the given name and app objects.

    Args:
        name: The name of the project.
        args: AppObject: A list of app objects for the project.
        auth_object: AuthObject|None: Authorization object.
    """
    if auth_object:
        if auth_object not in args:
            args = args + (auth_object,)
    else:
        for app_obj in args:
            if app_obj.secure:
                raise Exception("App Object can't be secure without Authenication Object")

    super().__init__(name=name, app_objects=args, auth_object=auth_object)